Closed Bug 1479628 Opened 7 years ago Closed 7 years ago

TodayPane mini-day shows the wrong day of the week

Categories

(Calendar :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

Attachments

(2 files, 2 obsolete files)

I thought I was the one that didn't know what day of the week it was, but the today pane is telling me it's Monday, and it's clearly not Monday.
Attached patch 1479628-today-pane-weekday-1.diff (obsolete) β€” β€” Splinter Review
The weekday is in a <deck>. (Why? No idea.) Our code sets the right selectedIndex on the deck, and then for some reason it goes back to 1. I *think* this has something to do with the de-XBL-ification of <deck>. This patch stops us using deck and does something more sensible.
Attachment #8996152 - Flags: review?(philipp)
Comment on attachment 8996152 [details] [diff] [review] 1479628-today-pane-weekday-1.diff Review of attachment 8996152 [details] [diff] [review]: ----------------------------------------------------------------- The weekday was in a deck so it would assume the length of the longest weekday, regardless of the locale. Can you make sure the new code does this as well?
Attachment #8996152 - Flags: review?(philipp) → review-
Attached patch 1479628-today-pane-weekday-2.diff (obsolete) β€” β€” Splinter Review
After further investigating, I think the weirdness in <deck> has to do with when it is initialised. This is coming to the surface because of the overlay change. If we push setDay to the end of the event queue, the initialisation is properly complete before we set which panel we want.
Attachment #8996152 - Attachment is obsolete: true
Attachment #8996589 - Flags: review?(philipp)
Comment on attachment 8996589 [details] [diff] [review] 1479628-today-pane-weekday-2.diff Review of attachment 8996589 [details] [diff] [review]: ----------------------------------------------------------------- ::: calendar/base/content/today-pane.js @@ +40,2 @@ > TodayPane.setShortWeekdays(); > + setTimeout(() => TodayPane.setDay(cal.dtz.now()), 0); Can you add a comment why we are doing this? Otherwise we'll most certainly forget :)
Attachment #8996589 - Flags: review?(philipp) → review+
That should do it. Should.
Attachment #8996589 - Attachment is obsolete: true
Attachment #8996632 - Flags: review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/2c2d3fef5935 Fix initialisation of TodayPane mini-day, to show the right day of the week. r=philipp DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 6.5
This patch seems to cause a js errors - appears for me directly when starting TB - with this patch there's no such error: <TypeError: aPeriod.start is undefined[Learn More] agenda-listbox.xml:213:17 > setOccurrence chrome://calendar/content/agenda-listbox.xml:213:17 > agendaListbox.addItemBefore chrome://calendar/content/agenda-listbox.js:298:5 > agendaListbox.addItem chrome://calendar/content/agenda-listbox.js:347:35 > onGetResult chrome://calendar/content/agenda-listbox.js:634:17 > onGetResult file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calCompositeCalendar.js:532:9 > queueItems file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calStorageCalendar.js:754:17 > handleResultItem file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calStorageCalendar.js:785:13 > getItems_ file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calStorageCalendar.js:846:26 > getItems/< file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calStorageCalendar.js:665:13 > postPone resource://calendar/modules/calUtils.jsm:212:13 > getItems file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calStorageCalendar.js:664:9 > getItems file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calCompositeCalendar.js:399:41 > execute chrome://calendar/content/agenda-listbox.js:684:29 > agendaListbox.refreshCalendarQuery chrome://calendar/content/agenda-listbox.js:693:5 > agendaListbox.calendarObserver.onLoad chrome://calendar/content/agenda-listbox.js:899:5 > notify resource://calendar/modules/utils/calDataUtils.jsm:68:32 > notify resource://calendar/modules/utils/calDataUtils.jsm:96:16 > onLoad file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calCompositeCalendar.js:44:13 > notify resource://calendar/modules/utils/calDataUtils.jsm:68:32 > notify resource://calendar/modules/utils/calDataUtils.jsm:96:16 > onLoad file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calICSCalendar.js:835:9 > onStreamComplete file:///F:/workspace/mozilla/thunderbird/obj-x86_64-pc-mingw32/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calICSCalendar.js:222:13
I haven't seen that, but I'm not totally surprised. One of these days I'm going to tear the today pane/agenda code apart in frustration and rebuild it. This should fix it.
(In reply to Geoff Lankow (:darktrojan) from comment #8) > Created attachment 8997213 [details] [diff] [review] > 1479628-today-pane-weekday-4.diff I should say, I considered doing it this way originally, but it causes us to set a timeout every time setDay runs, instead of just once at initialisation.
Attachment #8997213 - Flags: review?(makemyday)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 8997213 [details] [diff] [review] 1479628-today-pane-weekday-4.diff Review of attachment 8997213 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, that fixes it, r=me And to state the obvious - this patch needs to be applied on top of version 3 (which already was checked in).
Attachment #8997213 - Flags: review?(makemyday) → review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/7574b8f37534 Follow-up: only update weekday deck at end of event loop. r=MakeMyDay DONTBUILD
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: