Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Datetime Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Datetime:

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 ()

Static Protected Attributes

static $_format = null


Detailed Description

Definition at line 35 of file Datetime.php.


Member Function Documentation

_getFormat (  )  [protected]

Retrieve datetime format

Returns:
unknown

Definition at line 47 of file Datetime.php.

00048     {
00049         $format = $this->getColumn()->getFormat();
00050         if (!$format) {
00051             if (is_null(self::$_format)) {
00052                 try {
00053                     self::$_format = Mage::app()->getLocale()->getDateTimeFormat(
00054                         Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
00055                     );
00056                 }
00057                 catch (Exception $e) {
00058 
00059                 }
00060             }
00061             $format = self::$_format;
00062         }
00063         return $format;
00064     }

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 72 of file Datetime.php.

00073     {
00074         if ($data = $row->getData($this->getColumn()->getIndex())) {
00075             $format = $this->_getFormat();
00076             try {
00077                 $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
00078             }
00079             catch (Exception $e)
00080             {
00081                 $data = Mage::app()->getLocale()->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
00082             }
00083             return $data;
00084 
00085         }
00086         return $this->getColumn()->getDefault();
00087     }


Member Data Documentation

$_format = null [static, protected]

Date format string

Definition at line 40 of file Datetime.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