コード例 #1
0
ファイル: Date.php プロジェクト: xiaoguizhidao/magento
    public function render(Varien_Object $row)
    {
        $html = parent::render($row);
        $hlp = Mage::helper('udropship');
        if ($this->getColumn()->getEditable()) {
            $calGridUrl = Mage::getDesign()->getSkinUrl('images/grid-cal.gif');
            $date = $row->getData($this->getColumn()->getIndex());
            if ($date) {
                $date = $hlp->dateInternalToLocale($date);
            }
            $_dateFormat = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
            $_calDateFormat = Varien_Date::convertZendToStrFtime($_dateFormat, true, false);
            $htmlId = '_' . md5(uniqid(microtime(), true));
            $html .= <<<EOT
<input id="{$htmlId}" type="text" class="input-text" name="{$this->getColumn()->getId()}" value="{$date}" style="width:110px !important;" />
<!--img src="{$calGridUrl}" alt="" class="v-middle"title="" style="" /-->
</nobr>
<script type="text/javascript">
//<![CDATA[
    Calendar.setup({
        inputField: "{$htmlId}",
        ifFormat: "{$_calDateFormat}",
        showsTime: false,
        button: "{$htmlId}_trig",
        align: "Bl",
        singleClick : true
    });
//]]>
</script>
EOT;
        }
        return $html;
    }
コード例 #2
0
 public function render(Varien_Object $row)
 {
     $content = parent::render($row);
     $today = strtotime(date('Y-m-d'));
     $value = strtotime($row->getData($this->getColumn()->getIndex()));
     $color = $value > $today ? 'green' : 'red';
     return "<span style='color:{$color};font-weight:bold;'>{$content}</span>";
 }
コード例 #3
0
ファイル: Date.php プロジェクト: buttasg/cowgirlk
 public function render(Varien_Object $row)
 {
     try {
         return parent::render($row);
     } catch (Exception $e) {
         // Exception can be thrown if, eg, values do not correspond to dates
         return $e->getMessage();
     }
 }
コード例 #4
0
ファイル: Date.php プロジェクト: HelioFreitas/magento-pt_br
 /**
  * Retrieve date format
  *
  * @return string
  */
 protected function _getFormat()
 {
     $format = $this->getColumn()->getFormat();
     if (!$format) {
         if (is_null(self::$_format)) {
             try {
                 self::$_format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
             } catch (Exception $e) {
             }
         }
         $format = self::$_format;
     }
     return $format;
 }
コード例 #5
0
ファイル: Date.php プロジェクト: xiaoguizhidao/devfashion
 public function render(Varien_Object $row)
 {
     $data = $row->getData($this->getColumn()->getIndex());
     return is_empty_date($data) ? '' : parent::render($row);
 }