>> try:
>>
>> public function compareDates()
>> {
>>        return ($this->data[$this->alias]['start_date'] <
>> $this->data[$this->alias]['end_date']) ? true : false;
>> }
>>
>> var $validate = array('start_date'=>array('rule'=>'compareDates'));
>
> You'll need to transform the dates into an integer first:
>
> public function compareDates()
> {
>        return strtotime($this->data[$this->alias]['start_date']) <
> strtotime($this->data[$this->alias]['end_date']);
> }
>
> Also, note the ternary operator isn't strictly required because
> lessthan returns a boolean..

ahh yes - cleaner, like it.


-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en

Reply via email to