Possible Model Rule Error?

I have a rule in my model as follows:


array('record_date','type','type'=>'date','dateFormat' => 'm/j/y'),

Whatever format of a valid mySQL date I enter in the form’s textfield for that date, I am getting a validation error as follows:

Date Recorded: 2/1/11

[color="#FF0000"]Date Recorded must be date.[/color]

I have tried it without specifying the dateFormat in the rule and entering a date of 2011-02-01 but it still gives me the validation error :(

Is this a bug? Is there any workaround for it?

Yii uses CLDR definitions for date and time patterns: http://www.yiiframework.com/doc/api/1.1/CDateTimeParser

Fair enough - thanks, but that doesn’t explain why it would invalidate (no pun intended) when I exclude the date format in the rule and try to enter a date of 2011-02-01. Or does the date type rule require a date format argument?

P.S. I just used a proper Yii date format (m/d/yy) and it did indeed fix my problem with the validation error - thanks again!

The default date is ‘MM/dd/yyyy’. Take a look here.