You are here

function calendar_filter_year in Calendar 5

Same name and namespace in other branches
  1. 5.2 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.module
Implementation of hook_views_query() Insert filters into the query based on the current calendar view and the selected fields Used when the actual view arguments don't provide enough info to construct the query. i.e. on a view with no arguments…

File

./calendar.module, line 556
Adds calendar filtering and displays to Views.

Code

function calendar_filter_year(&$query, $arg) {
  calendar_load_calendar_api();
  $query->calendar_type = 'year';
  $query->year = calendar_part_is_valid($arg, 'year') ? $arg : calendar_user_date('year');
  $query->month = CALENDAR_EMPTY_ARG;
  $query->day = CALENDAR_EMPTY_ARG;
  $query->min = $query->year;
  $query->max = $query->year;
}