You are here

function date_views_handler_is_date in Date 7.3

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

Work out if the plugin is a 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
Modify the query for paging

File

date_views/date_views.module, line 497
Date Views module.

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;
}