Opened 7 years ago

Closed 7 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)

step1.gif (127.2 KB) - added by bill 7 years ago.
after setting date (via calendar) to march 31
step2.gif (128.2 KB) - added by bill 7 years ago.
then set date (via calendar) to march 11
windowsTimezones.gif (3.4 KB) - added by bill 7 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by bill

Owner: changed from bill to alan.kay
Status: newpending

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.

comment:2 Changed 7 years ago by alan.kay

Status: pendingnew

I'm using dojo version 1.8.3. And it is failing on test_DateTextBox.html for all DateTextBoxes?

comment:3 Changed 7 years ago by bill

Resolution: worksforme
Status: newclosed

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.

Last edited 7 years ago by bill (previous) (diff)

Changed 7 years ago by bill

Attachment: step1.gif added

after setting date (via calendar) to march 31

Changed 7 years ago by bill

Attachment: step2.gif added

then set date (via calendar) to march 11

comment:4 Changed 7 years ago by Adam Peller

Bill, perhaps BST is different from GMT in terms of daylight savings?

comment:5 Changed 7 years ago by Adam Peller

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 in reply to:  4 Changed 7 years ago by bill

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 7 years ago by bill

Attachment: windowsTimezones.gif added

comment:7 Changed 7 years ago by 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.

comment:8 Changed 7 years ago by Adam Peller

alan, can you please confirm your OS, also whether you've tried any other browsers?

comment:9 in reply to:  7 Changed 7 years ago by bill

Resolution: worksforme
Status: closedreopened

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 7 years ago by bill

Owner: changed from alan.kay to bill
Status: reopenedassigned

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 7 years ago by bill

Milestone: tbd1.10
Resolution: fixed
Status: assignedclosed

Fixed in [31424] but I wrote the wrong commit message.

Note: See TracTickets for help on using tickets.