diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index c8dd4d1..9a812f4 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -89,6 +89,12 @@ function datetime_theme() {
'template' => 'datetime-wrapper',
'render element' => 'element',
),
+ 'fieldset' => array(
+ 'template' => 'fieldset',
+ '#attributes' => array('class' => array('fieldgroup')),
+ 'render element' => 'element',
+ 'path' => drupal_get_path('module', 'system') . '/templates/',
+ ),
);
}
diff --git a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
index ca60f4a..3979273 100644
--- a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
+++ b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
@@ -53,7 +53,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
// title because the actual title display is handled at a higher level by
// the Field module.
- $element['#theme_wrappers'][] = 'datetime_wrapper';
+ $element['#theme_wrappers'][] = 'fieldset';
$element['#attributes']['class'][] = 'container-inline';
$element['#element_validate'][] = 'datetime_datetime_widget_validate';
diff --git a/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php b/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
index 0302c72..bbae8f3 100644
--- a/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
@@ -98,7 +98,7 @@ function testDateField() {
// Display creation form.
$this->drupalGet('entity_test/add');
$this->assertFieldByName("{$field_name}[0][value][date]", '', 'Date element found.');
- $this->assertFieldByXPath('//*[@id="edit-' . $field_name . '-wrapper"]/h4/span', '*', 'Required markup found');
+ $this->assertFieldByXPath('//*[@id="edit-' . $field_name . '-wrapper"]/fieldset/legend/span', '*', 'Required markup found');
$this->assertNoFieldByName("{$field_name}[0][value][time]", '', 'Time element not found.');
// Submit a valid date and ensure it is accepted.
diff --git a/core/modules/system/templates/fieldset.html.twig b/core/modules/system/templates/fieldset.html.twig
index 9e4fe68..d163c8c 100644
--- a/core/modules/system/templates/fieldset.html.twig
+++ b/core/modules/system/templates/fieldset.html.twig
@@ -16,6 +16,7 @@
* - children: The rendered child elements of the fieldset.
* - prefix: The content to add before the fieldset children.
* - suffix: The content to add after the fieldset children.
+ * - content: The form element to be output.
*
* @see template_preprocess_fieldset()
*
@@ -32,6 +33,7 @@
{{ prefix }}
{% endif %}
{{ children }}
+ {{ content }}
{% if suffix %}
{{ suffix }}
{% endif %}