1 date_views_argument_handler_simple.inc date_views_argument_handler_simple::date_forbid()

Add a callback.

To determine if we have moved outside the valid date range for this argument.

File

core/modules/date/views/date_views_argument_handler_simple.inc, line 406
Date API views argument handler.

Class

date_views_argument_handler_simple

Code

function date_forbid() {
  if (empty($this->argument)) {
    return TRUE;
  }
  $this->date_range = $this->date_handler->arg_range($this->argument);
  $this->min_date = $this->date_range[0];
  $this->max_date = $this->date_range[1];
  $this->limit = date_range_years($this->options['year_range']);
  $group = !empty($this->options['date_group']) ? $this->options['date_group'] : 0;

  // See if we're outside the allowed date range for our argument.
  if (date_format($this->min_date, 'Y') < $this->limit[0] || date_format($this->max_date, 'Y') > $this->limit[1]) {
    $this->forbid = TRUE;
    $this->view->build_info['fail'] = TRUE;
    return TRUE;
  }
  return FALSE;
}