diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 14be5db..084fe5c 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -570,10 +570,6 @@ function template_preprocess_datetime_form(&$variables) { function template_preprocess_datetime_wrapper(&$variables) { $element = $variables['element']; - if (!empty($element['#title'])) { - $variables['title'] = $element['#title']; - } - // Suppress error messages. $variables['errors'] = NULL; @@ -625,14 +621,6 @@ function template_preprocess_datetime_fieldset_wrapper(&$variables) { $legend_span_attributes['class'][] = 'form-required'; $variables['legend_span']['attributes'] = new Attribute($legend_span_attributes); } - if (!empty($element['#description'])) { - $description_attributes = array( - 'class' => 'description', - 'id' => $element['#attributes']['aria-describedby'], - ); - $variables['description']['attributes'] = new Attribute($description_attributes); - $variables['description']['content'] = $element['#description']; - } } /** diff --git a/core/lib/Drupal/Core/Datetime/Element/Datetime.php b/core/lib/Drupal/Core/Datetime/Element/Datetime.php index 44a3949..0f5377c 100644 --- a/core/lib/Drupal/Core/Datetime/Element/Datetime.php +++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php @@ -257,7 +257,7 @@ public static function processDatetime(&$element, FormStateInterface $form_state $element['date'] = array( '#type' => 'date', '#title' => t('Date'), - '#title_display' => 'invisible', + '#title_display' => 'before', '#value' => $date_value, '#attributes' => $element['#attributes'] + $extra_attributes, '#required' => $element['#required'], @@ -290,7 +290,7 @@ public static function processDatetime(&$element, FormStateInterface $form_state $element['time'] = array( '#type' => 'date', '#title' => t('Time'), - '#title_display' => 'invisible', + '#title_display' => 'before', '#value' => $time_value, '#attributes' => $element['#attributes'] + $extra_attributes, '#required' => $element['#required'], diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php index 61925af..e9f6e08 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php +++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php @@ -64,7 +64,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen case DateTimeItem::DATETIME_TYPE_DATE: $date_type = 'date'; $time_type = 'none'; - $element['#theme_wrappers'][] = 'datetime_wrapper'; + $element['#theme_wrappers'][] = 'datetime_fieldset_wrapper'; $date_format = $this->dateStorage->load('html_date')->getPattern(); $time_format = ''; break;