You are here

function date_views_argument_handler::init in Date 8

Same name and namespace in other branches
  1. 7.3 date_views/includes/date_views_argument_handler.inc \date_views_argument_handler::init()
  2. 7 date_views/includes/date_views_argument_handler.inc \date_views_argument_handler::init()
  3. 7.2 date_views/includes/date_views_argument_handler.inc \date_views_argument_handler::init()

Get granularity and use it to create the formula and a format for the results.

Overrides date_views_argument_handler_simple::init

File

date_views/includes/date_views_argument_handler.inc, line 18
Date API views argument handler. This argument combines multiple date arguments into a single argument where all fields are controlled by the same date and can be combined with either AND or OR.

Class

date_views_argument_handler
Date API argument handler.

Code

function init(&$view, &$options) {
  parent::init($view, $options);
  if (empty($this->view->date_info)) {
    $this->view->date_info = new stdClass();
  }
  if (empty($this->view->date_info->date_fields)) {
    $this->view->date_info->date_fields = array();
  }
  $this->view->date_info->date_fields = array_merge($this->view->date_info->date_fields, $this->options['date_fields']);
}