Skip to end of metadata
Go to start of metadata

<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 Framework: Zend_Filter_Date Component Proposal

Proposed Component Name Zend_Filter_Date
Developer Notes
Proposers Thomas Weidner
Zend Liaison TBD
Revision 1.0 - 9 July 2009: Initial Draft. (wiki revision: 4)

Table of Contents

1. Overview

Zend_Filter_Date is a filter which can convert a date string into another date format.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will convert dates from a input format to a output format.

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


Convert automatically based on the locale


Convert to a defined date format


Convert to a manually defined date format

9. Class Skeletons



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Aug 01, 2009

    <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() ) )

    Unknown macro: {<br />            $date = new Zend_Date( $input, $this->getFormatInput() );<br />            <span style="color}

    <br />
            <br />
           <span style="color: rgb(0,0,255);">return</span> $input;<br />

  2. Aug 02, 2010

    <p>Would this component take an arbitrary input date like strtotime() can ?</p>

    1. Aug 03, 2010

      <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>

  3. Aug 03, 2010

    <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>