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!
Best Answer
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.