0

I'm trying to find out why Magento won't display the "TIME" field for the date picker in the back end. We regularly create new attributes.

Ideas on how to show the time? I need an attribute to schedule product visibility on the website and the time HAS to be there.

Thanks

2 Answers 2

0

I'm newbie. But i found some links. I hope it helps you.

http://mydons.com/how-to-show-time-in-magento-date-picker/

https://stackoverflow.com/questions/13490860/how-add-time-to-datepicker-in-backend-magento

Thanks

0

Columns of type date are rendered in the admin via the block Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Date. If you look into this block you will see the function for rendering render and in this function you see that the date is formatted using the call to $format = $this->_getFormat();.

Having looked at the function _getFormat you can see that is simply gets the format attribute from the column and when one is not set it defaults.

/**
 * 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) {
                Mage::logException($e);
            }
        }
        $format = self::$_format;
    }
    return $format;
}

So what you should be able to do is when adding your column simply set the attribute format to how you want your date to be shown.

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.