validation - Validate datetime in Symfony2 -


i trying validate posted datetime string getting generic error "error: value not valid". data posted on restful api (if makes difference).

validation constraints through annotations in entity:

/**  * @var \datetime  *  * @orm\column(name="created_at", type="datetime", nullable=true)  * @assert\datetime(message="createdat must valid datetime string")  */ private $createdat; 

controller code processing form

 $user = new user();  $form = $this->createform(new usertype(), $user);  $form->submit($request);  if ($form->isvalid()) {..} 

if field not passed validation works.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -