Following issue wiht 1.8 CE:
When I’m trying to save CMS custom design info:
- Custom Design From
- Custom Design To
The validation fails ( even if dates are correct )
- I’m trying with chrome
- I have tried to change switch my locale (english/italian) but same issue
The root of the problem looks to be the following one:
Date picker fill dates in the format DD/MM/YYYY but validator.js (line 503) fail to create the new date(v)
obj.
It looks like date(string)
accept only date in the English/American format (MM/DD/YYYY)
Any idea how to fix this ?
I'm looking for a workaround as I'm developing an extension ...
Reference:
Inchoo: Magento: Date format troubles
Update
Some code may help to understand the scenario:
$dateFormatIso = Mage::app()->getLocale()->getDateFormat(
Mage_Core_Model_Locale::FORMAT_TYPE_SHORT
);
$fieldset->addField('date_from', 'date', array(
'name' => 'date_from',
'label' => Mage::helper('myhelper')->__('Date From'),
'image' => $this->getSkinUrl('images/grid-cal.gif'),
'format' => $dateFormatIso,
'class' => 'validate-date validate-date-range date-range-date-from'
));
$fieldset->addField('date_to', 'date', array(
'name' => 'date_to',
'label' => Mage::helper('myhelper')->__('Date To'),
'image' => $this->getSkinUrl('images/grid-cal.gif'),
'format' => $dateFormatIso,
'class' => 'validate-date validate-date-range date-range-date-to'
));