public static Date::processDate(&$element, FormStateInterface $form_state, &$complete_form)
Processes a date form element.
array $element: The form element to process. Properties used:
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
array $complete_form: The complete form structure.
array The processed element.
public static function processDate(&$element, FormStateInterface $form_state, &$complete_form) { // Attach JS support for the date field, if we can determine which date // format should be used. if ($element['#attributes']['type'] == 'date' && !empty($element['#date_date_format'])) { $element['#attached']['library'][] = 'core/drupal.date'; $element['#attributes']['data-drupal-date-format'] = [$element['#date_date_format']]; } return $element; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!Date.php/function/Date::processDate/8.1.x