You are here

function _datex_views_handler_argument_node_created_year::_datex_process in Datex 7.3

Convert the date back into gregorian, if possible.

1 call to _datex_views_handler_argument_node_created_year::_datex_process()
_datex_views_handler_argument_node_created_year::query in ./datex.views.inc
Fix the query for localized dates.

File

./datex.views.inc, line 26
Datex views integration.

Class

_datex_views_handler_argument_node_created_year

Code

function _datex_process() {
  if (isset($this->datexed) && $this->datexed) {
    return;
  }
  $this->datexed = TRUE;
  $calendar = _datex_date_field_calendar($this->options, FALSE);
  if (!$calendar) {
    return;
  }
  if (empty($this->argument) || strlen($this->argument) !== 4) {
    return $this
      ->_datex_invalid();
  }
  $year = (int) $this->argument;
  if ($year < 0) {
    return $this
      ->_datex_invalid();
  }
  $month = 6;
  $day = 25;
  $calendar
    ->setDateLocale($year, $month, $day);
  $this->argument = $calendar
    ->xFormat('Y');
}