{#
/**
 * @file
 * Theme implementation for a datetime form wrapper.
 *
 * Available variables:
 * - content: The form element to be output, usually a datelist, or datetime.
 * - title: The title of the form element.
 * - title_attributes: HTML attributes for the title wrapper.
 * - description: Description text for the form element.
 * - required: An indicator for whether the associated form element is required.
 *
 * @see template_preprocess_datetime_wrapper()
 */
#}
{% if title %}
  {% set title_classes = [
    required ? 'is-required',
  ] %}

  {% set legend = {
    'title': title,
    'attributes': title_attributes.addClass(title_classes),
  } %}

  {% include 'fieldset.html.twig' with {
    'attributes': attributes,
    'legend': legend,
    'legend_span': { 'attributes': create_attribute() },
    'required': required,
    'errors': errors,
    'description.content': description,
    'is_disabled': is_disabled,
    'type': 'datetime',
    'children': content,
  } %}
{% else %}
  {{ content }}

  {% if errors %}
    <div>{{ errors }}</div>
  {% endif %}

  {{ description }}
{% endif %}
