feat: show placeholders for individual date parts in date of birth field

This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent 8f274bbb44
commit 44e2d76525
2 changed files with 21 additions and 5 deletions
-5
View File
@@ -171,11 +171,6 @@ class BookingParticipantType extends AbstractType
'attr' => [
'class' => 'flex items-center space-x-2',
],
'placeholder' => [
'year' => 'Jahr',
'month' => 'Monat',
'day' => 'Tag',
],
], $getFieldState('dateOfBirth')))
->add('gender', ChoiceType::class, $this->mergeFieldState([
'label' => 'Geschlecht',
+21
View File
@@ -194,6 +194,27 @@
</div>
{%- endblock multiselect_widget -%}
{%- block birthday_widget -%}
{%- set placeholders = {
'day': 'Tag',
'month': 'Monat',
'year': 'Jahr'
} -%}
{%- set field_order = ['day', 'month', 'year'] -%}
<div {{ block('widget_container_attributes') }}>
{%- for field_name in field_order -%}
{%- set child = form[field_name] -%}
{%- set child_attr = child.vars.attr|default({}) -%}
{%- set child_attr = child_attr|merge({
'placeholder': placeholders[field_name],
'class': (child_attr.class|default('') ~ ' form-field')|trim
}) -%}
{{- form_widget(child, {'attr': child_attr}) -}}
{%- endfor -%}
</div>
{%- endblock birthday_widget -%}
{% block insurance_choice_widget %}
{%- if expanded -%}
{%- for child in form %}