Mage_Core_Block_Html_Calendar Class Reference

Inheritance diagram for Mage_Core_Block_Html_Calendar:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getTimezoneOffsetSeconds ()

Protected Member Functions

 _toHtml ()


Detailed Description

Definition at line 35 of file Calendar.php.


Member Function Documentation

_toHtml (  )  [protected]

Render block HTML

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 37 of file Calendar.php.

00038     {
00039         $localeCode = Mage::app()->getLocale()->getLocaleCode();
00040 
00041         // get days names
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         // get months names
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         // get "today" and "week" words
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         // get "am" & "pm" words
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         // get first day of week and weekend days
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         // define default format and tooltip format
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         // get days and months for en_US locale - calendar will parse exactly in this locale
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     }

getTimezoneOffsetSeconds (  ) 

Return offset of current timezone with GMT in seconds

Returns:
integer

Definition at line 88 of file Calendar.php.

00089     {
00090         return Mage::getSingleton('core/date')->getGmtOffset();
00091     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:53 2009 for Magento by  doxygen 1.5.8