Project utilizing ZF2 + Doctrine 2.
I Tried many formats. I'm working with a Form without validation.
My last try was:
$traindate = new Element\DateTime('trainDate');
$traindate->setAttributes(array(
'name' => 'trainDate',
'id' => 'trainDate',
'size' => '30',
'class' => 'datepicker',
'options' => array(
'label' => '',
'format' => 'd-m-Y H:i'
),
));
I need to use a input to set a date and time of a event. On Brazil the basic format is: 14-05-2014 14:20 15-05-2015 15:00
With means Days Months Year Hour Minutes, like I'm expressing on the Options -> Format.
This way always when I try to insert, i get the following messsage: The input does not appear to be a valid date
Removing the format, i can only pass by $form->isValid($data) by Y-m-d (American Format), but by the way i can't pass time to date too, which is causing me big troubles.
I need to set date PT_BR on Form/Input, Pass by validation, Convert Data do Mysql Format (YYYY-mm-dd HH:ii:ss). And then retrive from db and convert back to pt_br format.
But not even i can pass time with date to zf2 form, ever this error message.
I remove all filters from this form trying to get work, but doesn't work.
Where is the main problem?