{% set from = elements_customDateFormat(app.request.get('from')) %}
{% set to = elements_customDateFormat(app.request.get('to')) %}
{% set units = 0 %}
{% set guests = 0 %}
{% set roomrows = searchParam.getRoomrows() %}
{% if roomrows is iterable %}
{% for roomrow in roomrows %}
{% set units = units + roomrow.getUnits() %}
{% set guests = guests + roomrow.getAdults() %}
{% if roomrow.getChildAges() is not empty %}
{% set guests = guests + roomrow.getChildAges()|length %}
{% elseif roomrow.getChildBirthdays() is not empty %}
{% set guests = guests + roomrow.getChildBirthdays()|length %}
{% endif %}
{% endfor %}
{% endif %}
{% set nights = app.request.get('nights') %}
{% if nights is null and to is not empty and from is not empty %}
{% set nights = searchParam.getPeriod() %}
{% endif %}
<section class="card box-shadow">
<div class="card-body">
<script data-cookieconsent="ignore">
_config.search = true;
</script>
<div>
<time datetime="" class="js-search-data__arrival">{{ elements_dateFormat(from, 'date-long') }}</time>
-
<time datetime="" class="js-search-data__departure">{{ elements_dateFormat(to, 'date-long') }}</time>
(<span class="js-search-data__nights">{{ nights }}</span>)
</div>
<div class="js-search-data__occupancy"></div>
<div class="mt-2">
<button type="button" class="text-primary js-overlay__toggle btn-no-styling increased-click-area js-tracking--click-piwik"
data-target="#search-overlay"
data-tracking-category="Product list"
data-tracking-action="change search"
>
<span class="demi-icon demi-icon-edit icon-in-text"></span>
<span class="text-underline">{{ 'demi.search.change'|trans }}</span>
</button>
</div>
</div>
</section>