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 403
Date API views argument handler.

Class

date_views_argument_handler_simple
Date API argument handler.

Code

function date_forbid() {
  if (empty($this->argument)) {
    return TRUE;
  }
  $date_range = $this->date_handler->arg_range($this->argument);
  $this->min_date = $date_range[0];
  $this->max_date = $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;
}