Closed Bug 783775 Opened 12 years ago Closed 9 years ago

Add weeknumbers to minimonth

Categories

(Calendar :: Calendar Frontend, enhancement)

Lightning 1.5
x86
Windows XP
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 357012

People

(Reporter: litter, Unassigned)

Details

Attachments

(1 file)

Minimonth is missing weeknumbers.

I decided to add it myself, see patch. It works, and I'm now able to see weeknumbers. The weeknumber shown is according to ISO8601 for the monday shown in a week-row.

I wrote this code, and donate this code to the Lightning project.
Hi litter, thanks for your interest in working on Lightning.

You could just call the existing week number calculation code from http://mxr.mozilla.org/comm-central/source/calendar/base/src/calWeekInfoService.js That way it should work for users with a different week start day too and matches the week numbers already shown in Lightning.

In addition do not hard code any user interface strings like "Wk" in the source code. Maybe you can reuse the shortcalendarweek abbreviation from http://mxr.mozilla.org/comm-central/source/calendar/locales/en-US/chrome/calendar/calendar.properties, maybe you would have to define a new translatable string entity.

Some users including me don't want the minimonth to be messed up with week numbers, i.e. there should be a possibility to globally configure the behavior. And minimonth control is used in many places therefore maybe it is required too to specify what minimonth instances should should show the number and what not.
Hi, the week number calculation is really accurate and according to ISO8601. ISO8601 defines weeknumbers for weeks starting on mondays. Personally, I have weekdays displayed starting at sunday (which is after all the first day of creation). The weeknumber is always shown for the monday in that week.

You're of course right about avoiding hardcoding strings. My implementation is just a first attempt at adding weeknumbers.

You're of course right that weeknumbers should be globally configurable to show or not show.

It took me about 4 hours to add weeknumbers to minimonth, most time was spent in getting the weeknumber calculations correct for ISO8601. I did not have previous experience coding for Lightning, so that included trying to guess here and there how things work.

Unfortunately, I do not have much time at hands to make all improvements you suggested, but maybe if you can give me some suggestions on how to add the configurable items, I can give it a try?
This feature has been added with the patch for bug 357012.
It is enabled by default but it's also removable for those users that don't need it.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: