/**
  * {@inheritdoc}
  */
 public function settingsForm(array $form, FormStateInterface $form_state)
 {
     $form = parent::settingsForm($form, $form_state);
     $time = new DrupalDateTime();
     $format_types = $this->dateFormatStorage->loadMultiple();
     $options = [];
     foreach ($format_types as $type => $type_info) {
         $format = $this->dateFormatter->format($time->format('U'), $type);
         $options[$type] = $type_info->label() . ' (' . $format . ')';
     }
     $form['format_type'] = array('#type' => 'select', '#title' => t('Date format'), '#description' => t("Choose a format for displaying the date. Be sure to set a format appropriate for the field, i.e. omitting time for a field that only has a date."), '#options' => $options, '#default_value' => $this->getSetting('format_type'));
     return $form;
 }
 /**
  * {@inheritdoc}
  */
 public function settingsForm(array $form, FormStateInterface $form_state)
 {
     $form = parent::settingsForm($form, $form_state);
     $form['date_format'] = array('#type' => 'textfield', '#title' => $this->t('Date/time format'), '#description' => $this->t('See <a href="http://php.net/manual/function.date.php" target="_blank">the documentation for PHP date formats</a>.'), '#default_value' => $this->getSetting('date_format'));
     return $form;
 }