1 date_views_filter_handler_simple.inc date_views_filter_handler_simple::year_range()

File

core/modules/date/views/date_views_filter_handler_simple.inc, line 233
A standard Views filter for a single date field, using Date API form selectors and sql handling.

Class

date_views_filter_handler_simple
@file A standard Views filter for a single date field, using Date API form selectors and sql handling.

Code

function year_range() {
  $year_range = explode(':', $this->options['year_range']);
  if (substr($this->options['year_range'], 0, 1) == '-' || $year_range[0] < 0) {
    $this_year = date_format(date_now(), 'Y');
    $year_range[0] = $this_year + $year_range[0];
    $year_range[1] = $this_year + $year_range[1];
  }
  return $year_range;
}