The first one is because Zend_Date ignores all other parts except numbers.
The date parsing is actually not as strict as for strings.
To have a strict date parsing you would simply have to validate it as
string, for example with a fixed length.
A true from isDate does only mean that Zend_Date can handle this date with
the given format, it does not mean that the input format is strictly
identical.
Zend_Date can fix much notations automatically. This is the reason why it
returns true even if you may not have expected this.
But why should the second one be a wrong format ?
The year 1005 exists, the Month 09 exists and the day 01 exists.
It is very far in the past ut still this is a valid date.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "Kexiao Liao" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, October 15, 2008 4:20 PM
Subject: [fw-general] Zend_Date to validate input date format
I use Zend_Date class to validate the input date format as showing below
Zend_Date::isDate ( $value, 'yyyy-M-d' )
However the following input date values CAN NOT BE detected as wrong
format
2003--10-1
1005-09-01
Is this a bug for Zend_Date class? Please give your comments. Thanks.
Kevin
--
View this message in context:
http://www.nabble.com/Zend_Date-to-validate-input-date-format-tp19994516p19994516.html
Sent from the Zend Framework mailing list archive at Nabble.com.