Permalink
Browse files

BUG Fixed DateField date format error for IE8

On IE8, camel case element attributes are NOT included in the object returned
by $(elem).data(), meaning attrs defined in DateField.php (jqueryDateformat and
isoDateformat) are NOT seen by the code in DateField.js (ie the "config" var
doesn't have these set). Causing IE8 to fall back to using US date (mm/dd/yyyy)
formats. This can subsequently cause validation issues if the user's date
format is different.

DateField.js already explicitly checks for jquerydateformat (all lowercase)
so DateField.php has been modified to reflect the correct case for this
attribute name
  • Loading branch information...
1 parent ac48950 commit 9c1b4693f7890cffc3d48f4e3b609c7b334a0d36 Marcus Nyeholt committed Oct 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 forms/DateField.php
View
@@ -140,7 +140,7 @@ public function Field($properties = array()) {
$config = array(
'showcalendar' => $this->getConfig('showcalendar'),
'isoDateformat' => $this->getConfig('dateformat'),
- 'jqueryDateformat' => DateField_View_JQuery::convert_iso_to_jquery_format($this->getConfig('dateformat')),
+ 'jquerydateformat' => DateField_View_JQuery::convert_iso_to_jquery_format($this->getConfig('dateformat')),
'min' => $this->getConfig('min'),
'max' => $this->getConfig('max')
);

0 comments on commit 9c1b469

Please sign in to comment.