Public Member Functions | |
render (Varien_Object $row) | |
Protected Member Functions | |
_getFormat () | |
Protected Attributes | |
$_defaultWidth = 160 | |
Static Protected Attributes | |
static | $_format = null |
Definition at line 35 of file Date.php.
_getFormat | ( | ) | [protected] |
Retrieve date format
Definition at line 48 of file Date.php.
00049 { 00050 $format = $this->getColumn()->getFormat(); 00051 if (!$format) { 00052 if (is_null(self::$_format)) { 00053 try { 00054 self::$_format = Mage::app()->getLocale()->getDateFormat( 00055 Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM 00056 ); 00057 } 00058 catch (Exception $e) { 00059 00060 } 00061 } 00062 $format = self::$_format; 00063 } 00064 return $format; 00065 }
render | ( | Varien_Object $ | row | ) |
Renders grid column
Varien_Object | $row |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.
Definition at line 73 of file Date.php.
00074 { 00075 if ($data = $row->getData($this->getColumn()->getIndex())) { 00076 $format = $this->_getFormat(); 00077 try { 00078 if($this->getColumn()->getGmtoffset()) { 00079 $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); 00080 } else { 00081 $data = Mage::getSingleton('core/locale')->date($data, Zend_Date::ISO_8601, null, false)->toString($format); 00082 } 00083 } 00084 catch (Exception $e) 00085 { 00086 if($this->getColumn()->getTimezone()) { 00087 $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format); 00088 } else { 00089 $data = Mage::getSingleton('core/locale')->date($data, null, null, false)->toString($format); 00090 } 00091 } 00092 return $data; 00093 } 00094 return $this->getColumn()->getDefault(); 00095 }
$_defaultWidth = 160 [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.