Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

date order problem
 
cosmicbandito
Jr. Member
 
Total Posts:  16
Joined:  2008-06-04
 

Hi,

has anyone notized a date formating problem with the date input fields, e.g. with custom theme from? When I used the editors calendar widget and selected a date like june, 7th 2008 it entered 06/07/08 in the input field. After saving it to the database the input field was filled with: 08/07/06. Not to mention what happened, when I used values out of the boundaries for month and day values.

I could fix it editing the lib/Varien/Data/Form/Element/Date.php file at line 42 from:

if (!($datetimeFormat $this->getFormat())){
            
if($this->getTime()) {
                $datetimeFormat 
'%m/%d/%y %I:%M %p';
            
else {
                $datetimeFormat 
'%m/%d/%y';
            
}
            $this
->setFormat($datetimeFormat);

        
}

to

if (!($datetimeFormat $this->getFormat())){
            
if($this->getTime()) {
                $datetimeFormat 
'%y/%m/%d %I:%M %p';
            
else {
                $datetimeFormat 
'%y/%m/%d';
            
}
            $this
->setFormat($datetimeFormat);

        
}

This changes the Javascript Setup for the Calendar Widged, in which order to fill in the date values.

So has anyone else experienced it? I mean, I’m just wondering, if it is a bug or a local database configuration problem.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top