View Source

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



0.9 - 21 September 2006: Extension for Zend_Date.

Zend_Calendar is an extension class for Zend_Date.
It handles calendar formats different from gregorian calendar.

* [Zend_Date Proposal - Thomas Weidner]
* [Wiki Calendar Definition|]
* [Calendar Converter|]
* [Calendar Overview|]

* Simple API
* Same handling as Zend_Date to increase useability
* Locale aware
* Conversion between different Calendar Formats

* Zend_Exception
* [Zend_Date|Zend_Date Proposal - Thomas Weidner]
* [Zend_Locale|Zend_Locale Proposal - Thomas Weidner]

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.

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

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

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

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

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


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