DateTime Attribute for Admin->Products

2
72
views
Advertisement

Hello Friends …
If you want attribute type as Datetime instead of date Change in following files…
1.lib/Varien/Data/Form/Element/Date.php

Put this line at top of Function

$outputFormat = Mage::app()->getLocale()->getDateTimeFormat( Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);

replace

$displayFormat = Varien_Date::convertZendToStrFtime($outputFormat, true, (bool)$this->getTime());

with this

$displayFormat = Varien_Date::convertZendToStrFtime($outputFormat = Mage::app()->getLocale()->getDateTimeFormat( Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));

And Replace

$this->getTime() ? ‘true’ : ‘false’

With

$this->getTime() ? ‘true’ : ‘true’

Also change in
2.app/code/core/Mage/Core/Model/Locale.php
Find

public function date($date=null, $part=null, $locale=null, $useTimezone=true)

in this function Change this

$date = new Zend_Date($date, $part, $locale);

With this

$date = new Zend_Date($date, “”, $locale);

Thanks
Mayank Zalavadia

2 COMMENTS