<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Filter_Date is a filter which can convert a date string into another date format.Zend Framework: Zend_Filter_Date Component Proposal
Proposed Component Name
Zend_Filter_Date
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Filter_Date
Proposers
Thomas Weidner
Zend Liaison
TBD
Revision
1.0 - 9 July 2009: Initial Draft. (wiki revision: 4)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
- Zend_Date
5. Theory of Operation
This filter accepts date input and will convert it to another date output. It can be used to simplify the date handling as it allows to convert a localized date into another localized date.
6. Milestones / Tasks
- Milestone 1: [DONE] Proposal finished
- Milestone 2: Proposal accepted
- Milestone 3: Coding finished
- Milestone 4: Unit tests finished
- Milestone 5: Documentation finished
- Milestone 6: Component moved to core
7. Class Index
- Zend_Filter_Date
8. Use Cases
| UC-01 |
|---|
Convert automatically based on the locale
| UC-02 |
|---|
Convert to a defined date format
| UC-03 |
|---|
Convert to a manually defined date format
4 Comments
comments.show.hideAug 01, 2009
Ramon Henrique Ornelas
<p>I like this proposal, because in my application I built a similar filter</p>
<p>code example</p>
<p><span style="color: rgb(0,0,255);">public</span> function __construct( $formatOutput = 'yyyy-MM-dd' , $formatInput = 'dd/MM/yyyy' );</p>
<p> <span style="color: rgb(0,0,255);">public</span> function filter($input)<br />
{<br />
<span style="color: rgb(0,0,255);">if</span>( Zend_Date::isDate( $input , $this->getFormatInput() ) )
<br />
<br />
<span style="color: rgb(0,0,255);">return</span> $input;<br />
}</p>
Aug 02, 2010
Rob Allen
<p>Would this component take an arbitrary input date like strtotime() can ?</p>
Aug 03, 2010
Thomas Weidner
<p>This does not depend on this proposal.<br />
This is a feature which I want to add to Zend_Date 2.0.</p>
<p>But for now I have the problem that I can not localize most of these variants. (Note that 70% of the world do not speak english <ac:emoticon ac:name="wink" /> ).</p>
Aug 03, 2010
Ryan Mauger
<ac:macro ac:name="note"><ac:rich-text-body><p><strong>Community Review Team Recommendation</strong></p>
<p>The CR Team advises that this proposal be approved, but would like to see this filter provide the option to return a Zend_Date object</p></ac:rich-text-body></ac:macro>