protected function CalendarSystemsViewsDateTime::opSimple in Calendar Systems 8.3
@inheritDoc
Overrides Date::opSimple
File
- src/
Plugin/ views/ filter/ CalendarSystemsViewsDateTime.php, line 33
Class
- CalendarSystemsViewsDateTime
- Filter to handle dates stored as a timestamp.
Namespace
Drupal\calendar_systems\Plugin\views\filterCode
protected function opSimple($field) {
$this->value['value'] = CalendarSystemsArgHandlerTrait::translate($this->value['value']);
$cal = _calendar_systems_factory();
if ($cal) {
if ($cal
->parse($this->value['value'], 'Y-m-d H:i:s')) {
$this->value['value'] = $cal
->xFormat('Y-m-d H:i:s');
}
elseif ($cal
->parse($this->value['value'], 'Y-m-d')) {
$this->value['value'] = $cal
->xFormat('Y-m-d');
}
else {
$this->value['value'] = Drupal::time()
->getRequestTime();
}
}
parent::opSimple($field);
}