function DateFormatFormBase::submitForm

Same name and namespace in other branches
  1. 9 core/modules/system/src/Form/DateFormatFormBase.php \Drupal\system\Form\DateFormatFormBase::submitForm()
  2. 8.9.x core/modules/system/src/Form/DateFormatFormBase.php \Drupal\system\Form\DateFormatFormBase::submitForm()
  3. 10 core/modules/system/src/Form/DateFormatFormBase.php \Drupal\system\Form\DateFormatFormBase::submitForm()

Overrides EntityForm::submitForm

File

core/modules/system/src/Form/DateFormatFormBase.php, line 138

Class

DateFormatFormBase
Provides a base form for date formats.

Namespace

Drupal\system\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $form_state->setValue('pattern', trim($form_state->getValue('date_format_pattern')));
    parent::submitForm($form, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.