I would like to validate a date field with era using rules in my model. I looked at the CDateFormater->format() method and I find some explanations of the pattern. So I try this:
public function rules() {
return array(
array('dc_date_issued', 'type', 'type' => 'date', 'message' => '{attribute}: is not a valid date!',
'dateFormat' => 'yyyy-MM-dd G'),
)
}
But this seems not to work. The rule check rejects my date entries like ‘2001-11-30 AD’ or ‘0200-12-29 BC’. I have tried different patterns like yyyy-MM-dd GG or yyyy-MM-dd GGG. Same problem…
Any idea?
Thanks for your answer in advance
– Franck