public function MaestroEngineProcessCompletionTime::buildOptionsForm in Maestro 3.x
Same name and namespace in other branches
- 8.2 src/Plugin/views/field/MaestroEngineProcessCompletionTime.php \Drupal\maestro\Plugin\views\field\MaestroEngineProcessCompletionTime::buildOptionsForm()
Provide the options form.
Overrides FieldPluginBase::buildOptionsForm
File
- src/
Plugin/ views/ field/ MaestroEngineProcessCompletionTime.php, line 41
Class
- MaestroEngineProcessCompletionTime
- Field handler to translate the unixtime timestamp to a human readable format if you so choose to.
Namespace
Drupal\maestro\Plugin\views\fieldCode
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$options = [
'unix' => $this
->t('Database Timestamp'),
'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);
}