I built a form with a datetime input on Silex, using the FormBuilderInterface. The validation works perfectly, but when the datas are loaded to rebuild the form and fill in the inputs' values, the datetime's stays empty. I've been doing some researches but nothing so far so here I am.
The form is built in a class called EventType and fills an Event object. The $dateOfEvent property's setter asks for a \DateTime object and the getter returns $dateOfEvent without formatting it.
Here is what the EventType's builder's date of event part looks like :
->add('dateOfEvent', 'datetime', array(
'label' => 'Date of the event',
'widget' => 'single_text',
'input' => 'datetime',
))
If the Event object is already filled, all the inputs' values of the form are filled, except for the file input (which is normal) and the datetime input (which is not normal).
Here is a screen of what it looks like.