0

In my project I need to have only "day" and "month" to select no "year" or "h:m:s" required so I would like to set format to "d M" to bemore precise day (number) and month name as it is in "LONG" date format. I already tried:

        $fieldset->addField('date_to', 'date', array(
            'label'     => Mage::helper('dingles')->__('Date to'),
            'name'      => 'date_to',
            'time'      => false,
            'image'     => $this->getSkinUrl('images/grid-cal.gif'),
            'format'    => 'd M'
        ));

but it won't work, also it gives me hour:minute:second anyway. Is it possible to format it as I wanted ?

1 Answer 1

1

Do you want to display column in grid? If yes, then change type from date to datetime as shown below:

$this->addColumn(
 Mage::getModel('catalog/product')->formatUrlKey($key),
  array(
   'header'   => Mage::helper('core')->__($label),
   'index'    => $key,
   'filter'   => $isFilterable,
   'sortable' => true,
   'type' => 'datetime',
   'filter_condition_callback' => array($this, 'dateFilter'),
   )
 );
2
  • Hi not necesserily should be fine if i can select day and month only while editing/adding new event however then while event is executed filter should be able to select correcy event
    – Rob D. A.
    Commented Oct 1, 2017 at 10:59
  • what is $isFilterable variable? Commented Jun 21, 2018 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.