Skip to content
Snippets Groups Projects
Commit 56536b75 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4704: fixing date to always use array

parent f05b737c
No related branches found
No related tags found
1 merge request!66ISTWCMS-4704: adding date component with ability to handle multiple dates and...
{% if date is iterable %} {% if date|length == 1 %}
{% if date|length == 1 %}
{% include "@base/date-formats/_date-format.twig" with {
'date_format': date_format,
'date': date.0
} %}
{% else %}
{% for d in date %}
{% if loop.index0 == 0 %}
<details class="uw-date-details">
<summary role="button" aria-controls="edit-future-dates-collapsible" aria-expanded="false" aria-pressed="false" class="uw-date-details__summary">
{% include "@base/date-formats/_date-format.twig" with {
'date_format': date_format,
'date': d
}%}
</summary>
{% else %}
{% include "@base/date-formats/_date-format.twig" with {
'date_format': date_format,
'date': d
}%}
{% endif %}
{% if loop.last %}
</details>
{% endif %}
{% endfor %}
{% endif %}
{% else %}
{% include "@base/date-formats/_date-format.twig" with { {% include "@base/date-formats/_date-format.twig" with {
'date_format': date_format, 'date_format': date_format,
'date': date 'date': date.0
} %} } %}
{% else %}
{% for d in date %}
{% if loop.index0 == 0 %}
<details class="uw-date-details">
<summary role="button" aria-controls="edit-future-dates-collapsible" aria-expanded="false" aria-pressed="false" class="uw-date-details__summary">
{% include "@base/date-formats/_date-format.twig" with {
'date_format': date_format,
'date': d
}%}
</summary>
{% else %}
{% include "@base/date-formats/_date-format.twig" with {
'date_format': date_format,
'date': d
}%}
{% endif %}
{% if loop.last %}
</details>
{% endif %}
{% endfor %}
{% endif %} {% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment