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