Closed
Bug 446366
Opened 18 years ago
Closed 18 years ago
Header of multiweek view always assumes the week to begin with Sunday, no matter what the actual setting is
Categories
(Calendar :: Calendar Frontend, defect)
Calendar
Calendar Frontend
Tracking
(Not tracked)
VERIFIED
FIXED
0.9
People
(Reporter: rimas, Assigned: berend.cornelius09)
References
Details
Attachments
(4 files, 2 obsolete files)
|
15.31 KB,
image/png
|
Details | |
|
20.68 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.58 KB,
patch
|
Fallen
:
review+
|
Details | Diff | Splinter Review |
|
1.80 KB,
patch
|
dbo
:
review+
|
Details | Diff | Splinter Review |
The header of multiweek view lists wrong days, at least for locales where the week begins on Monday.
| Reporter | ||
Updated•18 years ago
|
OS: Windows XP → All
Hardware: PC → All
Comment 1•18 years ago
|
||
I can confirm this misbehavior using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17pre) Gecko/20080720 Calendar/0.9pre.
This was already reported in bug 444292 comment #38 but was ignored. The displayed week range is always considered to start with Sunday.
Blocks: 444292
| Reporter | ||
Updated•18 years ago
|
Summary: Days are offset by one in the header of multiweek view → Header of multiweek view always assumes the week to begin with Sunday, no matter what the actual setting is
| Assignee | ||
Updated•18 years ago
|
Assignee: nobody → Berend.Cornelius
| Assignee | ||
Comment 3•18 years ago
|
||
this should fix the problem as far as I could see. Currently the methods "startOfWeek()" and "endOfWeek()" available at a datetime object always return a week day based on Sunday as the start of the week. My introduced functions "getStartOfWeek()" and "getEndOfWeek()" that consider the preference settings "calendar.week.start" are probably not the wisest of all options but for the time they are sufficient IMHO.
Attachment #330583 -
Flags: review?(daniel.boelzle)
| Assignee | ||
Comment 4•18 years ago
|
||
After I added the first patch I thought that the "WeekTitleService.js is a more appropriate place for "getStartOfWeek()" and "getEndOfWee()" than calUtils is. If this new patch finds the approval of Daniel I would suggest to rename that corresponding interface to "calWeekFormatter" or something like that.
Attachment #330583 -
Attachment is obsolete: true
Attachment #330736 -
Flags: review?(daniel.boelzle)
Attachment #330583 -
Flags: review?(daniel.boelzle)
Comment 5•18 years ago
|
||
Comment on attachment 330736 [details] [diff] [review]
patch v. #2
>- // the start/end of the current object's week
>+ // Return the day of the week of the given time. Sunday is 1
Add a trailing point.
>Index: base/public/calIWeekTitleService.idl
We should probably rename this service to calIWeekInfoService.idl (and give it a new uuid).
>+/**
>+ * gets the first day of a week of a passed day under consideration
Start with uppercase "Gets...".
>+ * of the preference setting "calendar.week.start"
>+ *
>+ * @param aDate The dateTime to get get the start of the week for
>+ * @return a dateTime-object denoting the first day of the week
dto
>+ */
>+calIDateTime getStartOfWeek( in calIDateTime dateTime );
>+
>+
>+/**
>+ * gets the last day of a week of a passed day under consideration
dto.
>+ * of the preference setting "calendar.week.start"
>+ *
>+ * @param aDate The dateTime to get get the last day of the week for
>+ * @return a dateTime-object denoting the last day of the week
dto
>+ */
>+calIDateTime getEndOfWeek( in calIDateTime dateTime );
>+
>- var weekFormatter = Components.classes["@mozilla.org/calendar/weektitle-service;1"]
>- .getService(Components.interfaces.calIWeekTitleService);
>+ var weekFormatter = getWeekFormatter();
should call the service abbrev helper getWeekInfoService() then.
r=dbo
Attachment #330736 -
Flags: review?(daniel.boelzle) → review+
Comment 6•18 years ago
|
||
Berend, does your patch also fixes the following issue? If the first day of the week is set to Monday the displayed Calendar Weeks are wrong. For example it displays "Calendar Weeks 29-33" but expected is "Calendar Weeks 30-33".
| Assignee | ||
Comment 7•18 years ago
|
||
modified the recent patch and introduced a new Service calIWeekInfoService according to Daniel's suggestion in comment #5
patch v. #3 checked in on trunk and MOZILLA_1_8_BRANCH
->FIXED
| Assignee | ||
Comment 8•18 years ago
|
||
in reply to comment #6
>Berend, does your patch also fixes the following issue? If the first day of the
>week is set to Monday the displayed Calendar Weeks are wrong. For example it
>displays "Calendar Weeks 29-33" but expected is "Calendar Weeks 30-33".
Yes I verified this.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 9•18 years ago
|
||
Current win32 hourly builds crash during startup (see e.g. Talkback Incident ID TB48003989E). Adding the new calWeekInfoService.js file seems to fix it.
Attachment #331170 -
Flags: review?(philipp)
Updated•18 years ago
|
Attachment #331170 -
Flags: review?(philipp) → review+
Comment 10•18 years ago
|
||
Comment on attachment 331170 [details] [diff] [review]
[checked in] win32 bustage fix
Bustage fix checked in
Attachment #331170 -
Attachment description: win32 bustage fix → [checked in] win32 bustage fix
| Assignee | ||
Comment 11•18 years ago
|
||
As Andreas found out the week view displays a wrong range (see bug 430382 comment #37. As that is a regression of this issue I add the patch here.
Attachment #331280 -
Flags: review?(daniel.boelzle)
| Assignee | ||
Updated•18 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 12•18 years ago
|
||
And thank you, Stefan and Philipp, for reacting so fast with your bustage fix.
Updated•18 years ago
|
Attachment #331280 -
Flags: review?(daniel.boelzle) → review+
| Assignee | ||
Comment 13•18 years ago
|
||
patch v. #5 checked in on trunk and MOZILLA_1_8_BRANCH
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Updated•18 years ago
|
Flags: blocking-calendar0.9?
Target Milestone: --- → 0.9
Updated•18 years ago
|
Attachment #331280 -
Attachment description: patch v. #5 → [checked in] patch v. #5
Updated•18 years ago
|
Attachment #331085 -
Attachment description: patch v. #3 → [checked in] patch v. #3
Updated•18 years ago
|
Attachment #330736 -
Attachment is obsolete: true
Comment 14•18 years ago
|
||
Checked in lightning build 2008072919 and sunbird 20080729 -> VERIFIED
Status: RESOLVED → VERIFIED
Comment 15•18 years ago
|
||
It would be nice to create testcases for the week info service, especially getStartOfWeek/getEndOfWeek.
Flags: in-testsuite?
Comment 16•18 years ago
|
||
(In reply to comment #15)
> It would be nice to create testcases for the week info service, especially
> getStartOfWeek/getEndOfWeek.
I started writing some unit tests for the weekinfoservice.
You need to log in
before you can comment on or make changes to this bug.
Description
•