Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#7739 closed defect (worksforme)

TimeTextBox: lenient parsing of times not working

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.3
Component: Dijit - Form Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

see dijit/tests/form/test_TimeTextBox.html, tested on FF3/Mac

  1. In the second box, change 5:45 p.m. to 5:45 pm or 5:45pm. An error indicator will not be shown, but the drop down choices disappear, and if you hover over the arrows you get exceptions like
this.timeMenu.childNodes[0] is undefined
[Break on this error] var index = this.timeMenu.childNodes[0].index;
../../.....Picker.js (line 339)
Index or size is negative or greater than the allowed amount" code: "1
[Break on this error] var index = this.timeMenu.childNodes[0].index;
  1. Enter a value using "AM" or "PM" in uppercase, and you get a warning icon (and still no drop down) even though the value is parsed and accepted when you change focus.

dojo.date.locale.parse should accept all of these forms, unless strict:true is set.

Change History (6)

comment:1 Changed 11 years ago by Adam Peller

Description: modified (diff)

comment:2 Changed 11 years ago by Douglas Hays

Milestone: tbd1.3

comment:3 Changed 11 years ago by bill

Summary: lenient parsing of times not workingTimeTextBox: lenient parsing of times not working

comment:4 Changed 11 years ago by Douglas Hays

Owner: changed from Douglas Hays to Adam Peller

dojo.date.locale.parse("5:45:00 P.M.", {formatLength:"medium",locale:"",selector:"time",fullYear:true}) returns null

comment:5 Changed 11 years ago by Adam Peller

Resolution: worksforme
Status: newclosed

I think the translation scripts were erroneously picking up an alternate translation with the periods for "a.m." and "p.m." in Dojo 1.2. The current dojo.cldr definition uses "AM" and "PM" for English. The non-strict parsing should permit "AM" and "PM" where A.M. and P.M. are the given localizations, but the reverse is not true -- it's not really possible to know which localizations permit extra periods.

Running with the latest code, none of this is a problem anyway, even if I put the periods back in dojo/cldr/nls/en/gregorian.js for AM and PM, everything parses properly.

comment:6 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.