Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.0
-
Fix Version/s: 1.9.2
-
Component/s: Zend_Validate
-
Labels:None
Description
When filtering a value using the new Zend_Filter_LocalizedToNormalized, Zend_Validate_Date doesn't recognize the normalized date array. Zend_Validate_Date::isValid($value) just convert $value parameter to array. Or maybe Zend_Filter_LocalizedToNormalized could return a Zend_Date object, then Zend_Validate_Date should recognize a Zend_Date object. It's necessary, specially, when using Zend_Filter_Input to make batch filtering and validation. If it isn't solved, how could we use Zend_Filter_Input to convert and validate dates?
Actually, i think there is another questions about dates filtering and validations. Like, for example, it should be possible using Zend_Validate_GreaterThan, Between, Identical and LessThan to make aditional dates validations.
Why would you want to validate a normalized date with a localized validator ?
Zend_Filter_LocalizedToNormalized will not return a localized date object. A normalized date is, when the date object is splitted into it's date parts. That's the reason why you get a array. A string is always localized due to dayname, monthname timezone and so on...
A normalized date is no longer a Zend_Date object, that's the difference.
Additional you should note that a validator does never change content. A validator does only return true or false.
In my eyes this is not a bug but a discussable feature enhancement.
Regarding the other filters... you should not that these filters check only numbers.
There are already proposals for date validators but they have not been approved for incubator until now. But as said... also this is a new feature and not a bug.