You are here

public function Date::defaultArgumentForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/argument/Date.php \Drupal\views\Plugin\views\argument\Date::defaultArgumentForm()

Add an option to set the default value to the current date.

Overrides ArgumentPluginBase::defaultArgumentForm

File

core/modules/views/src/Plugin/views/argument/Date.php, line 91
Contains \Drupal\views\Plugin\views\argument\Date.

Class

Date
Abstract argument handler for dates.

Namespace

Drupal\views\Plugin\views\argument

Code

public function defaultArgumentForm(&$form, FormStateInterface $form_state) {
  parent::defaultArgumentForm($form, $form_state);
  $form['default_argument_type']['#options'] += array(
    'date' => $this
      ->t('Current date'),
  );
  $form['default_argument_type']['#options'] += array(
    'node_created' => $this
      ->t("Current node's creation time"),
  );
  $form['default_argument_type']['#options'] += array(
    'node_changed' => $this
      ->t("Current node's update time"),
  );
}