Skip to content

Instantly share code, notes, and snippets.

@brankoajzele
Created October 1, 2015 12:05
Show Gist options
  • Save brankoajzele/174a0d8fcef62584a17e to your computer and use it in GitHub Desktop.
Save brankoajzele/174a0d8fcef62584a17e to your computer and use it in GitHub Desktop.
Magento - date as default sort order in Magento admin area
public function __construct()
{
parent::__construct();
$this->setDefaultSort('picking_date');
$this->setDefaultDir('ASC');
$today = new DateTime;
$this->setDefaultFilter(array(
'picking_date' => array(
'from' => $today->format('d/m/Y'),
'to' => $today->format('d/m/Y'),
'locale' => Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId())
)
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment