Validating strings in YYYY-MM-DD format with Zend_Validate_Date in en_US locale
I am validating a user entered date string in the format YYYY-MM-DD
with Zend_Validate::is($value,'Date')
.
This call creates this hierarchy:
Zend_Validate::is() Zend_Validate_Date->isValid() Zend_Date::isDate() Zend_Locale_Format::getDate() Zend_Locale_Format::_parseDate()
Finally, with this exception, it fails:
Zend_Locale_Exception: Unable to parse date '2009-09-08' using 'MMM d, y' (M <> y) in /usr/share/php/Zend/Locale/Format.php on line 1001
I am using en_US as my application locale. How do I configure Zend_Validate to accept this date format? Is it possible to change the format of the date locale, for example?
+2
source to share
2 answers