Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Date Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Date:

Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract Mage_Adminhtml_Block_Abstract Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 render (Varien_Object $row)

Protected Member Functions

 _getFormat ()

Protected Attributes

 $_defaultWidth = 160

Static Protected Attributes

static $_format = null


Detailed Description

Definition at line 35 of file Date.php.


Member Function Documentation

_getFormat (  )  [protected]

Retrieve date format

Returns:
string

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

Parameters:
Varien_Object $row
Returns:
string

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     }


Member Data Documentation

$_defaultWidth = 160 [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.

Definition at line 37 of file Date.php.

$_format = null [static, protected]

Date format string

Definition at line 41 of file Date.php.


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

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