View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Filter_Date
{zone-data}

{zone-data:proposer-list}
[~thomas]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 9 July 2009: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Filter_Date is a filter which can convert a date string into another date format.
{zone-data}

{zone-data:references}
* [Zend_Date|http://framework.zend.com/manual/en/zend.date.html]
* [ZF-3185|http://framework.zend.com/issues/browse/ZF-3185]
{zone-data}

{zone-data:requirements}
* This component *will* convert dates from a input format to a output format.
{zone-data}

{zone-data:dependencies}
* Zend_Date
{zone-data}

{zone-data: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.
{zone-data}

{zone-data:milestones}
* 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
{zone-data}

{zone-data:class-list}
* Zend_Filter_Date
{zone-data}

{zone-data:use-cases}
||UC-01||
Convert automatically based on the locale
{code}
$filter = new Zend_Filter_Date();
print $filter->filter('10.August.2009 10:00:00');
// output could be: Aug 10, 2009 10:00 CET
{code}
||UC-02||
Convert to a defined date format
{code}
$filter = new Zend_Filter_Date(Zend_Date::ISO_8601);
print $filter->filter('10.August.2009 10:00:00');
// output could be: 10.08.2009 10:00:00 CET
{code}
||UC-03||
Convert to a manually defined date format
{code}
$filter = new Zend_Filter_Date('dd.MM.yy');
print $filter->filter('10.August.2009 10:00:00');
// output could be: 10.08.09
{code}
{zone-data}

{zone-data:skeletons}
{code}
class Zend_Filter_Date {
/**
* string $format Date format to use
*/
public function __construct($format);

/**
* Returns the set date format as string
* return $string
*/
public function getFormat();

/**
* Sets a new date format to filter to
* string $format Date format to use
*/
public function setFormat($format);

/**
* string|Zend_Date $input Date to filter
*/
public function filter($input);
}
{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>