Source of file LocalDatetime.php
Size: 1,346 Bytes - Last Modified: 2021-12-24T06:46:57+00:00
/var/www/docs.ssmods.com/process/src/code/forms/fieldtypes/LocalDatetime.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | <?php require_once 'Zend/Date.php'; /** * Localized date names, extension of {@link SS_Datetime} */ class LocalDatetime extends SS_Datetime { public function Nice($localized = true) { return $this->Format(null, $localized); } public function Date($localized = true) { return $this->Format(Zend_Date::DATE_MEDIUM, $localized); } public function Time($localized = true) { return $this->Format(Zend_Date::TIME_SHORT, $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 Format($format = null, $localized = true) { if ($this->value) { $zendDate = new Zend_Date($this->getValue(), 'y-MM-dd HH:mm:ss'); if ($localized) $zendDate->setLocale(i18n::get_locale()); return $zendDate->toString($format); } } } |