This is what I have:
- One select field with months
- One select field with years
But in the month select field I would like to add an default option like:
<option value="current">Current</option>
I have no idea how to add the default option, an placeholder is no option. This is my code right now, using a dateType
->add('startDate', DateType::class, [
'label' => 'Start date',
'label_attr' => array('class' => 'sr-only'),
'placeholder' => [
'year' => 'Year',
'month' => 'Month',
],
'years' => range(date('Y')-70, date('Y')),
])
Who can help me with this? Thanks!