Hi,
I'd like to collect a birth date from a normal input field (I *hate*
date dropdowns, especially for birthdays)
So I've tried this regex for the date_format, but it doesn't work:
$this->setValidator('dob',new sfValidatorDate(array('required'=>true,
'date_format' => "=(?P<day>[0-9]{1,2})(\.|/|\s)".
"(?P<month>([0-9]{1,2}|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))".
"(\.|/|\s)(?P<year>[0-9]{1,4})=is")));
This one works:
$this->setValidator('dob',new sfValidatorDate(array('required'=>true,
'date_format' => "=(?P<day>[0-9]{1,2})(\.|/|\s)".
"(?P<month>[0-9]{1,2})".
"(\.|/|\s)(?P<year>[0-9]{1,4})=is")));
Alternatively, sfValidatorDate is supposed to recognise strtotime
compatible strings? How can I make it look at that as well?
Kind Regards,
Jochen
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en