<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]]></ac:plain-text-body></ac:macro> <ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Validate currently does not have an easy means to compare date such that they can be easily used in form validation. This proposal strives to create such validators. The component will provide a means to add validators to form elements such that their values can be tested in comparison to some benchmark date.
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[![]()
Under Construction
This proposal is under construction and is not ready for review.Zend Framework: Zend_Validate_DateBetween
Zend_Validate_DateLessThan
Zend_Validate_DateGreaterThan Component Proposal
Proposed Component Name
Zend_Validate_DateBetween
Zend_Validate_DateLessThan
Zend_Validate_DateGreaterThan
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Validate_DateBetween
Zend_Validate_DateLessThan
Zend_Validate_DateGreaterThan
Proposers
Niek Slatius
Zend Liaison
TBD
Revision
0.1 - 6 March 2009: Initial Draft. (wiki revision: 6)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
5. Theory of Operation
6. Milestones / Tasks
7. Class Index
- Zend_Validate_DateBetween
- Zend_Validate_DateLessThan
- Zend_Validate_DateGreaterThan
2 Comments
comments.show.hideMar 07, 2009
Thomas Weidner
<p>All classes are nearly related and should therefor be based on one abstract or default class.<br />
Maybe all date content validators should be within one Validate_Date directory.</p>
<p>Also string input should be accepted as input.<br />
As you rely on Zend_Date there should be a way to set the wished locale, which is not always the system locale.</p>
Oct 02, 2009
Joe Gornick
<p>Here's my version of a date GreaterThan/LessThan validator.</p>
<p><a href="http://gist.github.com/200256">http://gist.github.com/200256</a></p>
<p>I took Thomas's recommendations of creating a base Date Validate class and also making the validator locale-aware.</p>
<p>The thing different about my implementation is it allows you to specify a field name to lookup in the context argument of the isValid method. This allows you to compare against another date field when adding validators to form elements.</p>
<p>Keep in mind, my example is working for my implementation and has not been thoroughly tested by any means. However, I wanted to share my approach on this validator as I think it would be a great addition to Zend Framework.</p>