public function date_views_filter_handler_simple::year_range in Date 7.2
Same name and namespace in other branches
- 8 date_views/includes/date_views_filter_handler_simple.inc \date_views_filter_handler_simple::year_range()
- 7.3 date_views/includes/date_views_filter_handler_simple.inc \date_views_filter_handler_simple::year_range()
@todo Document this.
File
- date_views/
includes/ date_views_filter_handler_simple.inc, line 276 - A standard Views filter for a single date field.
Class
- date_views_filter_handler_simple
- A standard Views filter for a single date field.
Code
public 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;
}