[symfony-users] [Symfony2] DateField type error

2011-02-18 Thread Lideln
Hi there,

I added a DateField to my form.
$this-add(new DateField('dateBirth', array('years' = range(date('Y')
- 100, date('Y') - 17;

1) If I do not specify the type (which is DateTime by default), I get
this error when submitting :
Expected argument of type string, object given (DateValidator.php line
29)
My Domain Object :
/**
 * @validation:Date()
 * @var date $dateBirth
 */
private $dateBirth;
(ok, a workaround would be to not use validation, but that is lame ^^)

2) If I create my field with option type = 'string', I get this
error :
Fatal error: Call to a member function format() on a non-object in
Doctrine\DBAL\Types\DateType.php on line 44

I'm totally lost with this DateField thing... (see my other post about
the 'data' parameter with the default value).

Please, any help somewhere ? Point me to some tutorial or
documentation, and I will study it. But looking at the code, I humbly
think it is a bug of the framework.

What do you think ?

Kind regards,

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [Symfony2] DateField type error

2011-02-18 Thread Bernhard Schussek
Hi Lideln,

The @Date constraint checks for date strings with format -MM-DD.
What you want is @AssertType(\DateTime). Maybe we have a naming
issue here.

Bernhard

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en