You are here

public function MaestroEngineCompletedTimestamp::buildOptionsForm in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/field/MaestroEngineCompletedTimestamp.php \Drupal\maestro\Plugin\views\field\MaestroEngineCompletedTimestamp::buildOptionsForm()

Provide the options form.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/MaestroEngineCompletedTimestamp.php, line 41

Class

MaestroEngineCompletedTimestamp
Field handler to generate completed timestamp.

Namespace

Drupal\maestro\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $options = [
    'short' => $this
      ->t('Short ( 12/01/1901 - 23:59 )'),
    'medium' => $this
      ->t('Medium ( Tue, 12/01/1901 - 23:59 )'),
    'long' => $this
      ->t('Long ( Tuesday, December 1, 1901 - 23:59 )'),
    'html_datetime' => $this
      ->t('HTML5 Date/Time ( YYYY-MM-DDThh:mm:ssTZD )'),
  ];
  $form['date_format'] = [
    '#title' => $this
      ->t('Date Format'),
    '#type' => 'select',
    '#default_value' => isset($this->options['date_format']) ? $this->options['date_format'] : 'name',
    '#options' => $options,
  ];
  parent::buildOptionsForm($form, $form_state);
}