Review Request: Display correct week number in the calendar widget

Andras Mantia amantia at kde.org
Sat Feb 14 15:30:09 CET 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/76/
-----------------------------------------------------------

Review request for Plasma.


Summary
-------

The calendar widget currently display incorrect and misleading week numbers if according to the regional setting the week doesn't start with Monday (like in  the US). The widget uses KCalendarSystem::weekNumber to find the week number for the first date in the row. This date can be any day of the week, not only Monday, as the calendar widget takes into the account the regional settings. But KCalendarSystem::weekNumber determines the ISO week number as it is stated in its documentation and that one starts with Mondays. This results in a wrong week number shown.
Examples: in 2009 the week1 is 1-4, week 2 is 5-11th of January. If the regional is US, the second row starts from 4-10. For 4th the week number is 1, so 1 is shown for that week. This is wrong, that week contains days both from the first and second week. 
The solution is either to calculate the week number according to the regional settings or display the week number correctly in ISO numbering. The patch does the second one, displays the week number(s) where the days in that row belong. So in US regional, row 2 (weeks 4-5) would be assigned to weeks 1/2 (4 is in 1, 5-10 is in 2).


Diffs
-----

  trunk/KDE/kdebase/workspace/libs/plasmaclock/calendartable.cpp 925810 

Diff: http://reviewboard.kde.org/r/76/diff


Testing
-------

Tested with all possible weekday starts. The calendar default size needs to be bigger to fit week numbers like 52/53, sincerely don't know where to do it, that change probably needs to be done in the applet itself.


Thanks,

Andras



More information about the Plasma-devel mailing list