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) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -