I am using sfValidatorDate to check that a date is in the 'mm/dd/yy'
format. 'date_format' is causing Min and Max to fail. I believe the
failure is caused by the shortened year format.

How can I get the validator to enforce both the date format and the
min/max. I tried using the 'date_format' option.

$this->setValidator('start_date', new sfValidatorDate(
  array(
    'min' => mktime(0,0,0,1,1,date('y',time())),
    'max' => mktime(0,0,0,12,31,date('y',time())+1),
    'required' => true,
    'date_format' => '/^[0-9]{2}\/[0-9]{2}\/[0-9]{2}$/',
    'date_output'=>'m/d/y'
  ),array(
    'min'=>'Must start this year',
    'max'=>'Cannot span two years',
    'bad_format'=>'Must be MM/DD/YY',
    'required'=>'Start Date required')
  ));

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

Reply via email to