calendar_filter_month

Versions
5
calendar_filter_month(&$query, $arg)

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

Parameters

object $query

integer $arg

▾ 3 functions call calendar_filter_month()

calendar_filter_day in contributions/calendar/calendar.module
Callback for day filter. Build year, month, day, min, and max into query object.
calendar_handler_arg_month in contributions/calendar/calendar.module
Custom views handler for the month argument.
calendar_views_query_alter in contributions/calendar/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…

Code

contributions/calendar/calendar.module, line 583

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

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.