Skip to main content

Search and Top Navigation

#7062 closed bug (fixed)

Opened March 04, 2011 02:21AM UTC

Closed May 04, 2011 09:00PM UTC

Last modified May 04, 2011 09:01PM UTC

$.datepicker.parseDate does not work for some locale date strings

Reported by: daepark Owned by:
Priority: minor Milestone: 1.8.13
Component: ui.datepicker Version: 1.8.10
Keywords: Cc:
Blocked by: Blocking:
Description

Failing on these strings:

"2011 十一 22"            // zh-CN
"2012 十二 24"            // zh-CN
"14 červenec 2007"       // cs
"20 Tháng 10 2010"       // vi
"22 Tháng 11 2011"       // vi
"22 Tháng Mười Một 2011" // vi
"24 Tháng 12 2012"       // vi
"24 Tháng Mười Hai2012"  // vi

Here's test case:

var tests = [
  "yy M d",  "2011 十一 22",           "zh-CN",
  "yy M d",  "2012 十二 24",           "zh-CN",
  "d MM yy", "14 červenec 2007",       "cs",
  "d M yy",  "20 Tháng 10 2010",       "vi",
  "d M yy",  "22 Tháng 11 2011",       "vi",
  "d MM yy", "22 Tháng Mười Một 2011", "vi",
  "d M yy",  "24 Tháng 12 2012",       "vi",
  "d MM yy", "24 Tháng Mười Hai2012",  "vi"
];
for (var i=0,l=tests.length; i<l; i+=3) {
  try {
    console.log($.datepicker.parseDate(tests[i], tests[i+1], $.datepicker.regional[tests[i+2]]));
  }
  catch (ex) {
    console.error("format", tests[i], "dateStr", tests[i+1], "regionCode", tests[i+2], "Error", ex);
  }
};
Attachments (0)
Change History (4)

Changed May 04, 2011 08:12PM UTC by kzys comment:1

I've sent a pull request at https://github.com/jquery/jquery-ui/pull/201.

Changed May 04, 2011 09:00PM UTC by Scott González comment:2

resolution: → fixed
status: newclosed

Merge pull request #201 from kzys/trac-7062

Fixed #7062 - $.datepicker.parseDate does not work for some locale date strings.

Changeset: 511b86b31efd16e2966a1155cdb47b951f01c204

Changed May 04, 2011 09:01PM UTC by Kato Kazuyoshi comment:3

Datepicker: Greedy matching in month name. Fixed #7062 - $.datepicker.parseDate does not work for some locale date strings.

(cherry picked from commit a891e81e06c7ce491ae9058aea2fa7fbd51eddb6)

Changeset: f9faa0ab5fb2b9f332de93fd9d8fb97e9957ff6d

Changed May 04, 2011 09:01PM UTC by scottgonzalez comment:4

milestone: 1.91.8.13