I was following tutorial book for Symfony2. I was doing project with forms.
Chapter 12: Forms | 150
My code:
public function newAction(Request $request)
{
$task = new Task();
$task->setTask('Find EiM group');
$task->setDueDate(new DateTime('tomorrow'));
$form = $this->createFormBuilder($task)
->add('task', 'text')
->add('dueDate', 'date')
->add('save', 'submit')
->getForm();
return $this->render('AcmeTaskBundle:Default:new.html.twig', array(
'form' => $form->createView()));
}
And I'm getting error from the topic.
No default option is configured for constraint Symfony\Component\Validator\Constraints\DateTime
What it can be? How to fix it? I followed example in book strictly.