In a Symfony Form I have:
->add('fechalimite', DateType::class, [
'format' => 'dMMMMyyyy',
'data' => new \DateTime(),
])
Opening the form, I have in fechalimite field today's date: 15 December 2018. I can change the field, ex. 28 December 2018, and I submit the change in database without problem.
The problem come editing the form. When I edit the field take today's date, not 28 December 2018.
I am looking for a data default that does not remain in edit mode.
How can solve it?