function Date::validateOptionsForm
Same name in other branches
- 9 core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::validateOptionsForm()
- 8.9.x core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::validateOptionsForm()
- 10 core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::validateOptionsForm()
Overrides FilterPluginBase::validateOptionsForm
File
-
core/
modules/ views/ src/ Plugin/ views/ filter/ Date.php, line 49
Class
- Date
- Filter to handle dates stored as a timestamp.
Namespace
Drupal\views\Plugin\views\filterCode
public function validateOptionsForm(&$form, FormStateInterface $form_state) {
parent::validateOptionsForm($form, $form_state);
if (!empty($this->options['exposed']) && $form_state->isValueEmpty([
'options',
'expose',
'required',
])) {
// Who cares what the value is if it's exposed and non-required.
return;
}
$this->validateValidTime($form['value'], $form_state, $form_state->getValue([
'options',
'operator',
]), $form_state->getValue([
'options',
'value',
]));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.