Year Validation Problem


array('vigencia_desde', 'type', 'type'=>'date', 'dateFormat'=>'d/M/yyyy'),

according to this validator

11/11/1900 is not a valid date

11/11/1950 is a valid date

issue with old year!!

Have your tried CDateValidator instead of this.

Hi Rajith R!

I think there is no issue with ‘old years’! After check the code from CTypeValidator.dateFormat, you can see that when you use the ‘dateFormat’ property with ‘type’ => ‘date’, basically the ‘dateFormat’ is going to use the CDateTimeParser.

If you check the code from CDateTimeParser, you can see that it uses the PHP date function and also the Yii CTimestamp.class to support UNIX timestamp, where u can read on the ‘top comments’ about the UNIX timestamp that is beyond the range of 1901-2038 on Unix systems and 1970-2038 on Windows systems.

Also you can read more about this in, especially on the changelog, ie from PHP 5.1.x: