{% if nbenfants > 0 %}
{% if error > 0 %}
<p id="enfant_datenaissance_error" class="txt-rose"> {{ 'Merci de renseigner la/les date(s) de naissance du/des enfant(s) participant(s) pour finaliser la réservation'|trans }} </p>
{% endif %}
{#<div class="margin-bottom-10"><b>{{ 'reservation.voyageurs.dates_naissance_mineur' |trans({}, 'app') |raw }}</b></div>#}
{% for i in 1..nbenfants %}
{% set dateEnfant = "" %}
{% if travellers['agesenfants'] is defined and travellers['agesenfants'][i-1] is defined %}
{% set dateEnfant = travellers['agesenfants'][i-1] %}
{% set date_parts = dateEnfant|split('/') %}
{% if date_parts is iterable and date_parts|length == 3 %}
{% set dateEnfant = date_parts[2] ~ '-' ~ date_parts[1] ~ '-' ~ date_parts[0] %}
{% endif %}
{% endif %}
<div class="margin-top-10 text-right">
<div class="form-group">
<div class="form-group-dateSelector">
<div></div>
<input class="btn-fiche-recherche datenaissance dateenfant form-control margin-off" id="enfant_datenaissance_{{ i }}" name="enfant_datenaissance_{{ i }}" type="date" placeholder="JJ/MM/AAAA" min="{{ minDate }}" max="{{ maxDate }}" value="{{ dateEnfant }}" autocomplete="off" />
<button type="button" class="btn btn-default ageValidate">Valider</button>
</div>
</div>
</div>
{% endfor %}
{% endif %}