3 namespace Drupal\system\Form;
5 use Drupal\Core\Form\FormStateInterface;
8 * Provides a form for editing a date format.
10 class DateFormatEditForm extends DateFormatFormBase {
15 public function form(array $form, FormStateInterface $form_state) {
16 $form = parent::form($form, $form_state);
18 $now = t('Displayed as %date', ['%date' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id())]);
19 $form['date_format_pattern']['#field_suffix'] = ' <small data-drupal-date-formatter="preview">' . $now . '</small>';
20 $form['date_format_pattern']['#default_value'] = $this->entity->getPattern();
28 protected function actions(array $form, FormStateInterface $form_state) {
29 $actions = parent::actions($form, $form_state);
30 $actions['submit']['#value'] = t('Save format');
31 unset($actions['delete']);