Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11332 closed defect (fixed)

dojo.date.locale does not parse 30/31 day of the month in ddMMMyyyy pattern

Reported by: echtykov Owned by: Adam Peller
Priority: high Milestone: 1.5
Component: Date Version: 1.4.3
Keywords: Cc:
Blocked By: Blocking:

Description

The following will return null or undefined:

dojo.date.locale.parse("30Aug2006",{datePattern:"ddMMMyyyy",selector: "date",locale: "en"});

while the following is parsed correctly:

dojo.date.locale.parse("29Aug2006",{datePattern:"ddMMMyyyy",selector: "date",locale: "en"});

The problem is in the regular expression that is getting built up in dojo.date.locale.parse.

I would suggest the following fix:

--- dojo/date/locale.js   (revision *****)
+++ dojo/date/locale.js   (working copy)
@@ -517,7 +517,7 @@
                                s = p2+'[1-9]|'+p3+'[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6]';
                                break;
                        case 'd':
-                               s = '[12]\\d|'+p2+'[1-9]|3[01]';
+                               s = '3[01]|[12]\\d|'+p2+'[1-9]';
                                break;
                        case 'w':
                                s = p2+'[1-9]|[1-4][0-9]|5[0-3]';


Change History (5)

comment:1 Changed 9 years ago by echtykov

This is similar to the ticket #6242.

comment:2 Changed 9 years ago by Adam Peller

Milestone: tbd1.5.1

comment:3 Changed 9 years ago by Adam Peller

Milestone: 1.5.11.5

comment:4 Changed 9 years ago by Adam Peller

Resolution: fixed
Status: newclosed

comment:5 Changed 9 years ago by bill

For future reference, was fixed in [22338].

Note: See TracTickets for help on using tickets.