who gives me a hand to create a custom validator for Zend Framework, which checks that a date is in to a range?
Example:
dateGT = 2011-09-05
dateLT = 2011-07-05
if the form field is set to: dateFieldForm = 2011-08-15 I expect the validator returns true!
and if the form field is set to: dateFieldForm = 2011-10-15 I expect the validator returns false!
I write a test phpunit for class by venimus. I hope it can help someone.
}
this class has been really helpful to me thanks again!
Sorry, large code ahead:
Usage:
Uses the globally set date format (stored in Zend_Registry('Locale')).
It is also advisable to customize the error messages per case.
Latest update: fixed wrong default optional parameter which should be NULL instead of True. Changed the messages to be less confusing. Some formatting and whitespace.