function calendar_filter_month in Calendar 5.2
Same name and namespace in other branches
- 5 calendar.module \calendar_filter_month()
Callback for month filter. Build year, month, day, min, and max into query object.
Parameters
object $query:
integer $arg:
3 calls to calendar_filter_month()
- calendar_filter_day in ./
calendar.module - Callback for day filter. Build year, month, day, min, and max into query object.
- calendar_handler_arg_month in ./
calendar.module - Custom views handler for the month argument.
- _calendar_views_query_alter in ./
calendar.inc - @file All the code used while processing a calendar is stored in this file and is included only when needed.
File
- ./
calendar.module, line 174 - Adds calendar filtering and displays to Views.
Code
function calendar_filter_month(&$query, $arg) {
$now = date_now();
$query->calendar_type = 'month';
if (!isset($query->year)) {
calendar_filter_year($query, date_format($now, 'Y'));
}
$query->month = calendar_part_is_valid($arg, 'month') ? $arg : date_format($now, 'm');
$query->day = CALENDAR_EMPTY_ARG;
}