View Source

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

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

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

{zone-data:revision}
0.9 - 21 September 2006: Extension for Zend_Date.
{zone-data}

{zone-data:overview}
Zend_Calendar is an extension class for Zend_Date.
It handles calendar formats different from gregorian calendar.
{zone-data}

{zone-data:references}
* [Zend_Date Proposal - Thomas Weidner]
* [Wiki Calendar Definition|http://en.wikipedia.org/wiki/Calendar]
* [Calendar Converter|http://www.calendarhome.com/converter/]
* [Calendar Overview|http://www.projectpluto.com/calendar.htm]
{zone-data}

{zone-data:requirements}
* Simple API
* Same handling as Zend_Date to increase useability
* Locale aware
* Conversion between different Calendar Formats
{zone-data}

{zone-data:dependencies}
* Zend_Exception
* [Zend_Date|Zend_Date Proposal - Thomas Weidner]
* [Zend_Locale|Zend_Locale Proposal - Thomas Weidner]
{zone-data}

{zone-data:operation}
Zend_Calendar will extend Zend_Date to work also with other calendar formats than the gregorian ones.
It will have an adaptor interface to convert between the different formats.
{zone-data}

{zone-data:milestones}
* [IN PROGRESS] Acceptance of Proposal
* Code Basic Class with Adaptor Interface
* Code Arabic Adaptor
* Write unit tests
* Write Docu
* Code Chinese Adaptor
* Code Hebrew Adaptor
* Code Indian Adaptor
* Code Julian Adaptor
* Code Persian Adaptor
* Code Bahai Adaptor
* Code French Adaptor
{zone-data}

{zone-data:class-list}
* Zend_Calendar
* Zend_Calendar_Exception
* Zend_Calendar_Arabic
* Zend_Calendar_Chinese
* Zend_Calendar_Hebrew
* Zend_Calendar_Julian
* Zend_Calendar_xxxxx (other calendar formats as written in milestones)
{zone-data}

{zone-data:use-cases}
Define a arabic date, convert to gregorian
{code}
$cal = Zend_Calendar(Zend_Calendar::ARABIC); // Without input the actual date is used
$cal->setDate('1385 Dey 05');
print $cal->toGregorian();
{code}

Work with Calendars
{code}
$cal = Zend_Calendar(Zend_Calendar::GREGORIAN, '13 Februar 2009', 'de_AT'); // locale aware useage
$cal->addYear(4);
print $cal->toArabic();
{code}

Work with Calendars
{code}
$cal = Zend_Calendar(Zend_Calendar::ARABIC, '1385 Dey 05'); // locale aware useage
$cal->addYear(4);
print $cal->toString();
$cal->setTime('13:22:45');
if ($cal->compare('2006-03-05 13:22:45')) {
print "Same Date even if other calendar format";
}
{code}

{zone-data}

{zone-data:skeletons}
{code}
class Zend_Calendar extends Zend_Date
{
/** A toxxx function for each Calendar format
*/
function toArabic()
function toGregorian()
function toChinese()
...

/** What calendar is used actually
*/
function usedCalendar()

/** Extend every function which generates gregorian output to output the
* used calendar format instead
*/
function toString()
function set()
function get()
}

class Zend_Calendar_Arabic {}
class Zend_Calendar_Chinese {}
class Zend_Calendar_Gregorian {} // default adaptor where all other adaptors are routed to as it integrates Zend_Date
class Zend_Calendar_Exception {}
{code}
{zone-data}

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