1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33: 34:
35: class Mage_Core_Block_Html_Calendar extends Mage_Core_Block_Template
36: {
37: protected function _toHtml()
38: {
39: $localeCode = Mage::app()->getLocale()->getLocaleCode();
40:
41:
42: $days = Zend_Locale_Data::getList($localeCode, 'days');
43: $this->assign('days', array(
44: 'wide' => Mage::helper('core')->jsonEncode(array_values($days['format']['wide'])),
45: 'abbreviated' => Mage::helper('core')->jsonEncode(array_values($days['format']['abbreviated']))
46: ));
47:
48:
49: $months = Zend_Locale_Data::getList($localeCode, 'months');
50: $this->assign('months', array(
51: 'wide' => Mage::helper('core')->jsonEncode(array_values($months['format']['wide'])),
52: 'abbreviated' => Mage::helper('core')->jsonEncode(array_values($months['format']['abbreviated']))
53: ));
54:
55:
56: $this->assign('today', Mage::helper('core')->jsonEncode(Zend_Locale_Data::getContent($localeCode, 'relative', 0)));
57: $this->assign('week', Mage::helper('core')->jsonEncode(Zend_Locale_Data::getContent($localeCode, 'field', 'week')));
58:
59:
60: $this->assign('am', Mage::helper('core')->jsonEncode(Zend_Locale_Data::getContent($localeCode, 'am')));
61: $this->assign('pm', Mage::helper('core')->jsonEncode(Zend_Locale_Data::getContent($localeCode, 'pm')));
62:
63:
64: $this->assign('firstDay', (int)Mage::getStoreConfig('general/locale/firstday'));
65: $this->assign('weekendDays', Mage::helper('core')->jsonEncode((string)Mage::getStoreConfig('general/locale/weekend')));
66:
67:
68: $this->assign('defaultFormat', Mage::helper('core')->jsonEncode(Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM)));
69: $this->assign('toolTipFormat', Mage::helper('core')->jsonEncode(Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_LONG)));
70:
71:
72: $days = Zend_Locale_Data::getList('en_US', 'days');
73: $months = Zend_Locale_Data::getList('en_US', 'months');
74: $enUS = new stdClass();
75: $enUS->m = new stdClass();
76: $enUS->m->wide = array_values($months['format']['wide']);
77: $enUS->m->abbr = array_values($months['format']['abbreviated']);
78: $this->assign('enUS', Mage::helper('core')->jsonEncode($enUS));
79:
80: return parent::_toHtml();
81: }
82:
83: 84: 85: 86: 87:
88: public function getTimezoneOffsetSeconds()
89: {
90: return Mage::getSingleton('core/date')->getGmtOffset();
91: }
92:
93: 94: 95: 96: 97: 98:
99: public function getStoreTimestamp($store = null)
100: {
101: return Mage::getSingleton('core/locale')->storeTimeStamp($store);
102: }
103: }
104: