You are here

public function Date::validateOptionsForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::validateOptionsForm()

Simple validate handler

Overrides FilterPluginBase::validateOptionsForm

File

core/modules/views/src/Plugin/views/filter/Date.php, line 48
Contains \Drupal\views\Plugin\views\filter\Date.

Class

Date
Filter to handle dates stored as a timestamp.

Namespace

Drupal\views\Plugin\views\filter

Code

public function validateOptionsForm(&$form, FormStateInterface $form_state) {
  parent::validateOptionsForm($form, $form_state);
  if (!empty($this->options['exposed']) && $form_state
    ->isValueEmpty(array(
    '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(array(
    'options',
    'operator',
  )), $form_state
    ->getValue(array(
    'options',
    'value',
  )));
}