datetime - DeliveryDate in Order Item Grid not sorting correctly -
i have created sales order item grid in admin panel in magento. grid displays display date correctly. when try sort based on delivery date not work. include delivery date follows:
$this->addcolumn('proptions', array( 'header' => mage::helper('sales')->__('delivery date'), 'index' => 'proptions', 'renderer' => new bakery_core_block_adminhtml_renderer_data(), 'type' => 'datetime', ));
in renderer_data following:
$val = substr($_option['value'],0,10); //returns format dd/mm/yyyy $val = str_replace("/","-",$val); //returns dd-mm-yyyy $datetimestamp = mage::getmodel('core/date')->timestamp(strtotime($val)); $format_val = date('d m y', $datetimestamp); // returns e.g. 13 aug 2013
i have set type in grid column datetime. still doesn't sort date in correct order. how can fix issue?
thanks, neet
i checked grid in promo , seems use 'date' 'type'
example
$this->addcolumn('to_date', array( 'header' => mage::helper('catalogrule')->__('date expire'), 'align' => 'left', 'width' => '120px', 'type' => 'date', 'default' => '--', 'index' => 'to_date', ));
Comments
Post a Comment