I have the following form in symfony:
->add('horaI', ChoiceType::class, array(
'label' => 'Hora Inicio',
'placeholder' => 'Seleccione una hora',
'attr' => array(
'class' => 'form-name form-control'
),
'choices' => array(
'08:00' => '8:00',
'09:00' => '9:00',
'10:00' => '10:00',
'11:00' => '11:00',
'12:00' => '12:00',
'13:00' => '13:00',
'14:00' => '14:00',
'15:00' => '15:00',
'16:00' => '16:00',
'17:00' => '17:00',
)))
date is of time format, so when I save the form it shows me this error: Error Call to a member function format () on string.
I thought 2 solutions a datapicker with this bundle: link
But it does not only show the hours but also the headers of the month and year, besides hours that I do not need to take into account and that can cause the user to choose badly.
This is the problem. I'm working with symfony 3.2.x
Greetings