00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Core_Block_Html_Calendar extends Mage_Core_Block_Template
00036 {
00037 protected function _toHtml()
00038 {
00039 $localeCode = Mage::app()->getLocale()->getLocaleCode();
00040
00041
00042 $days = Zend_Locale_Data::getList($localeCode, 'days');
00043 $this->assign('days', array(
00044 'wide' => Zend_Json::encode(array_values($days['format']['wide'])),
00045 'abbreviated' => Zend_Json::encode(array_values($days['format']['abbreviated']))
00046 ));
00047
00048
00049 $months = Zend_Locale_Data::getList($localeCode, 'months');
00050 $this->assign('months', array(
00051 'wide' => Zend_Json::encode(array_values($months['format']['wide'])),
00052 'abbreviated' => Zend_Json::encode(array_values($months['format']['abbreviated']))
00053 ));
00054
00055
00056 $this->assign('today', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'relative', 0)));
00057 $this->assign('week', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'field', 'week')));
00058
00059
00060 $this->assign('am', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'am')));
00061 $this->assign('pm', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'pm')));
00062
00063
00064 $this->assign('firstDay', (int)Mage::getStoreConfig('general/locale/firstday'));
00065 $this->assign('weekendDays', Zend_Json::encode((string)Mage::getStoreConfig('general/locale/weekend')));
00066
00067
00068 $this->assign('defaultFormat', Zend_Json::encode(Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM)));
00069 $this->assign('toolTipFormat', Zend_Json::encode(Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_LONG)));
00070
00071
00072 $days = Zend_Locale_Data::getList('en_US', 'days');
00073 $months = Zend_Locale_Data::getList('en_US', 'months');
00074 $enUS = new stdClass();
00075 $enUS->m = new stdClass();
00076 $enUS->m->wide = array_values($months['format']['wide']);
00077 $enUS->m->abbr = array_values($months['format']['abbreviated']);
00078 $this->assign('enUS', Zend_Json::encode($enUS));
00079
00080 return parent::_toHtml();
00081 }
00082
00083
00084
00085
00086
00087
00088 public function getTimezoneOffsetSeconds()
00089 {
00090 return Mage::getSingleton('core/date')->getGmtOffset();
00091 }
00092 }