You are here

function calendar_filter_day in Calendar 5

Same name and namespace in other branches
  1. 5.2 calendar.module \calendar_filter_day()

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

Parameters

object $query:

integer $arg:

1 call to calendar_filter_day()
calendar_handler_arg_day in ./calendar.module
Custom views handler for the day argument.

File

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

Code

function calendar_filter_day(&$query, $arg) {
  calendar_load_calendar_api();
  if (!isset($query->month)) {
    calendar_filter_month($query, calendar_user_date('month'));
  }
  $query->calendar_type = 'day';
  $query->day = calendar_part_is_valid($arg, 'day') ? $arg : calendar_user_date('day');
  $query->min .= '-' . sprintf('%02d', $query->day);
  $query->max .= '-' . sprintf('%02d', $query->day);
}