Source of file LocalDate.php
Size: 1,321 Bytes - Last Modified: 2021-12-24T06:46:57+00:00
/var/www/docs.ssmods.com/process/src/code/forms/fieldtypes/LocalDate.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | <?php require_once 'Zend/Date.php'; /** * Localized date names, extension of {@link Date} */ class LocalDate extends Date { public function Nice($localized = true) { return $this->Format(null, $localized); } public function Year($localized = true) { return $this->Format(Zend_Date::YEAR, $localized); } public function Month($localized = true) { return $this->Format(Zend_Date::MONTH_NAME, $localized); } public function Day($localized = true) { return $this->Format(Zend_Date::DAY, $localized); } public function ShortMonth($localized = true) { return $this->Format(Zend_Date::MONTH_SHORT, $localized); } public function Long($localized = true) { return $this->Format(Zend_Date::DATE_LONG, $localized); } public function Full($localized = true) { return $this->Format(Zend_Date::DATE_FULL, $localized); } public function Short($localized = true) { return $this->Format(Zend_Date::DATE_SHORT, $localized); } public function Medium($localized = true) { return $this->Format(Zend_Date::DATE_MEDIUM, $localized); } public function Format($format = null, $localized = true) { if ($this->value) { $zendDate = new Zend_Date($this->getValue(), 'y-MM-dd'); if ($localized) $zendDate->setLocale(i18n::get_locale()); return $zendDate->toString($format); } } } |