You are here

function calendar_filter_year in Calendar 5.2

Same name and namespace in other branches
  1. 5 calendar.module \calendar_filter_year()

Callback for year filter. Build year, month, day, min, and max into query object.

Parameters

object $query:

integer $arg:

4 calls to calendar_filter_year()
calendar_filter_month in ./calendar.module
Callback for month filter. Build year, month, day, min, and max into query object.
calendar_filter_week in ./calendar.module
Callback for week filter. Build year, month, day, min, and max into query object.
calendar_handler_arg_year in ./calendar.module
Custom views handler for the year 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 150
Adds calendar filtering and displays to Views.

Code

function calendar_filter_year(&$query, $arg) {
  $query->calendar_type = 'year';
  $query->year = calendar_part_is_valid($arg, 'year') ? $arg : date_format(date_now(), 'Y');
  $query->month = CALENDAR_EMPTY_ARG;
  $query->day = CALENDAR_EMPTY_ARG;
}