Opened 8 years ago
Closed 8 years ago
#17033 closed defect (fixed)
Calendar sticks on 31st March 2013
Reported by: | alan.kay | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.10 |
Component: | Dijit | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I'm attempting to set dates in a dateTextBox using the calendar drop down. When I select the 31st of March 2013 a strange thing happens, I now cannot select any other date in March. Firebug's console shows "TypeError?: newCell is undefined" in CalendarLite?.js (line 134).
If I set use the calendar drop down to select a date in any other month, it is then possible to select another date in March.
I'm using the locale 'en-gb' and I think British Summer Time started on the 1st of April 2013, this is the only reason I can think of that would cause this but I'm not sure how
Browser: Firefox 20.0
Attachments (3)
Change History (14)
comment:1 Changed 8 years ago by
Owner: | changed from bill to alan.kay |
---|---|
Status: | new → pending |
comment:2 Changed 8 years ago by
Status: | pending → new |
---|
I'm using dojo version 1.8.3. And it is failing on test_DateTextBox.html for all DateTextBoxes?
comment:3 Changed 8 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Sorry, it just doesn't reproduce for me, using 1.8.3 on Windows XP with the timezone set to GMT. If you can debug it yourself maybe we could add some code to fix it, but I can't do anything with this report. I'll attach my screenshots showing it working for me.
comment:4 follow-up: 6 Changed 8 years ago by
Bill, perhaps BST is different from GMT in terms of daylight savings?
comment:5 Changed 8 years ago by
See also #9107. Could be related to this long standing Mozilla bug? https://bugzilla.mozilla.org/show_bug.cgi?id=487897 Alan, does this happen on any other browser? What OS are you running?
comment:6 Changed 8 years ago by
Replying to peller:
Bill, perhaps BST is different from GMT in terms of daylight savings?
There's no BST settings. Here are the choices:
Only the one I picked seems sensible. Is there some other configuration I should be setting?
Changed 8 years ago by
Attachment: | windowsTimezones.gif added |
---|
comment:7 follow-up: 9 Changed 8 years ago by
Just saw on your screen shots that you selected the 31st March 2009. The date that BST begins changes year upon year, for 2009 you should have attempted 29th March 2009.
comment:8 Changed 8 years ago by
alan, can you please confirm your OS, also whether you've tried any other browsers?
comment:9 Changed 8 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Replying to alan.kay:
Just saw on your screen shots that you selected the 31st March 2009. The date that BST begins changes year upon year, for 2009 you should have attempted 29th March 2009.
Ah, sorry, yes now I can reproduce (on both IE8 and Chrome) after clicking either 29th March 2009 or 31st March 2013. Didn't realize it depended on the year.
comment:10 Changed 8 years ago by
Owner: | changed from alan.kay to bill |
---|---|
Status: | reopened → assigned |
Well, this is complicated.
When the Calendar is created, every <td> gets a dijitDate property representing the number of seconds since Jan 1, 1970 GMT to 1AM on that day. Not sure if that's 1AM GMT or 1AM local timezone though, but in this case it's the same.
The dijitDate for March 1, 2009 starts out as 1235869200000, but after clicking March 29 and reopening the calendar, the grid is regenerated with the first entry as dijitDateValue == 1234865600000. (Note that the Calendar is recreated every time you open the drop down, even if it's the same month as before.)
The error is related to the initially focused date of the Calendar, generally the selected date, this code in _populateGrid:
var month = new this.dateClassObj(this.currentFocus); month.setDate(1);
I managed to fix it by changing the above code to:
var month = new this.dateClassObj(this.currentFocus); month.setDate(1); month = this._patchDate(month); // needed if currentFocus is start or end of DST
I'll check that in, assuming it doesn't cause other regressions.
comment:11 Changed 8 years ago by
Milestone: | tbd → 1.10 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in [31424] but I wrote the wrong commit message.
Hmm, it works fine for me, running against the latest code or the latest in the 1.8 branch on WinXP / FF20. I even used control panel to set my timezone to GMT. Is it failing for you on test_DateTextBox.html? If not, you'll need to attach your test case.