You are here

function _datex_views_handler_argument_node_created_fulldate::_datex_process in Datex 7.3

Convert the date back into gregorian, if possible.

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

File

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

Class

_datex_views_handler_argument_node_created_fulldate

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) !== 8) {
    return $this
      ->_datex_invalid();
  }
  $split0 = str_split($this->argument, 4);
  $split1 = str_split($split0[1], 2);
  $year = (int) $split0[0];
  $month = (int) $split1[0];
  $day = (int) $split1[1];
  if ($month < 1 || $month > 12) {
    return $this
      ->_datex_invalid();
  }
  if ($day < 1 || $day > 31) {
    return $this
      ->_datex_invalid();
  }
  $calendar
    ->setDateLocale($year, $month, $day);
  $this->argument = $calendar
    ->xFormat('Ym');
}