#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 11 years ago by
comment:2 Changed 11 years ago by
Milestone: | tbd → 1.5.1 |
---|
comment:3 Changed 11 years ago by
Milestone: | 1.5.1 → 1.5 |
---|
comment:4 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
This is similar to the ticket #6242.