You are here

function date_views_handler_is_date in Date 8

Same name and namespace in other branches
  1. 7.3 date_views/date_views.module \date_views_handler_is_date()
  2. 7.2 date_views/date_views.module \date_views_handler_is_date()

The instanceof function makes this work for any handler that was derived from 'views_handler_filter_date' or 'views_handler_argument_date', which includes core date fields like the node updated field.

The test for $handler->min_date tells us that this is an argument that not only is derived from the views date handler but also has been processed by the Date Views filter or argument code.

1 call to date_views_handler_is_date()
date_views_plugin_pager::query in date_views/includes/date_views_plugin_pager.inc
Transfer date information from the argument to the view so the pager theme can use it and update the date argument value to whatever is set by the pager.

File

date_views/date_views.module, line 360

Code

function date_views_handler_is_date($handler, $type = 'argument') {
  switch ($type) {
    case 'filter':
      return $handler instanceof views_handler_filter_date && !empty($handler->min_date);
    case 'argument':
      return $handler instanceof views_handler_argument_date && !empty($handler->min_date);
  }
  return FALSE;
}