Bug 224351 - KDE should support local week numbering system
Summary: KDE should support local week numbering system
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unclassified
Component: klocale (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: John Layt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-26 17:36 UTC by Jeffrey
Modified: 2011-05-08 13:36 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.0


Attachments
When my week begins on Sunday, I have two weeks listed. (32.22 KB, image/jpeg)
2010-01-26 17:43 UTC, Jeffrey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey 2010-01-26 17:36:08 UTC
Version:            (using KDE 4.3.4)
OS:                Linux
Installed from:    Debian testing/unstable Packages

In both Kalendar (Kontact) and in the Plasma Calendar, when KDE is set to have its weeks beginning on Sunday (via System Settings > Regional > Time and Dates)
http://imagebin.ca/view/j3griU.html

the various Calendars all seem to indicate that my weeks are actually two weeks (see 1/2 and 2/3 on the left side) :
http://imagebin.ca/view/CBiIBZ.html
http://imagebin.ca/view/zBbVqA1.html

When weeks are set to begin on Monday, there is only one week listed:
http://imagebin.ca/view/5l2WMFpD.html

In North America, all weeks begin with Sunday.

Per this Wikipedia link, there are many ways to determin which is a 'week'
http://en.wikipedia.org/wiki/Seven-day_week#Week_numbering
Comment 1 Jeffrey 2010-01-26 17:40:25 UTC
Apologies, this is not a plasma but; please reassign if possible.
Comment 2 Jeffrey 2010-01-26 17:43:28 UTC
Created attachment 40262 [details]
When my week begins on Sunday, I have two weeks listed.

When my week begins on Sunday, I have two weeks listed in Kalendar and also on the Plasma Calendar applet.
Comment 3 John Layt 2010-01-27 22:13:16 UTC
The week numbering used in KDE is always ISO standard week numbering, i.e. it always starts on a Monday, hence the 2 week numbers being shown in calendars when they start the week on any other day.  The Start of Week is purely for which day is shown first in calendar widgets and does not affect day numbering (Monday = 1) or week numbering.

Week numbering is on my 4.5 todo list, but I still have to think through the in-depth issues involved.

Changing this to a wish item and updating the title as it's not a bug per-se, rather a symptom of the deeper design choice.  If we do support other week numbering methods the code as currently written would automatically start showing just 1 week number.
Comment 4 John Layt 2010-02-01 13:18:56 UTC
Forgot to assign to myself...
Comment 5 John Layt 2011-05-08 13:35:52 UTC
Git commit b9201497f65bc7097c7c2a6b83eaa68891463b32 by John Layt.
Committed on 08/05/2011 at 11:12.
Pushed by jlayt into branch 'master'.

KCalendarSystem: Add support for alternative Week Number Systems

KDE currently only supports the ISO Week Number system used by most of
the world.  However some countries such as the USA use other week number
systems.  These systems are defined and supported by POSIX, Unicode,
Windows, and Mac so it's probably a good idea for us to support them
too.

Note that the old weekNumber() api will always return the ISO Week Number
for backwards compatability, but is now deprecated.  The new week() api
will return the localized Week Number and should replace all calls to
weekNumber().  If an app always requires the ISO Week then the week()
call can take an optional parameter to set this.

Supported systems are:

ISO Week: Current ISO week support.  The value of Week Start Day is
ignored.

First Full Week: Week 1 starts on the Week Start Day set in KLocale,
any days before this day fall in the last week of the previous year

First Partial Week: Week 1 starts on Jan 1 with Week 2 starting on the
Week Start Day in Klocale, so Week 1 may have less than 7 days.

Simple Week: Week 1 starts on Jan 1 with a new week starting every 7
days thereafter.  The value of Week Start Day is ignored.

Other systems may be added if required.

FEATURE: 224351
FIXED-IN: 4.7.0

M  +199  -67   kdecore/date/kcalendarsystem.cpp     
M  +80   -4    kdecore/date/kcalendarsystem.h     
M  +12   -0    kdecore/date/kcalendarsystemprivate_p.h     
M  +6    -14   kdecore/date/klocalizeddate.h     
M  +5    -0    kdecore/localization/klocale.cpp     
M  +16   -6    kdecore/localization/klocale.h     
M  +3    -0    kdecore/localization/klocale_kde.cpp     
M  +527  -0    kdecore/tests/kcalendartest.cpp     
M  +1    -0    kdecore/tests/kcalendartest.h     

http://commits.kde.org/kdelibs/b9201497f65bc7097c7c2a6b83eaa68891463b32
Comment 6 John Layt 2011-05-08 13:36:47 UTC
Git commit 7fcbdbc0935b5919437f4e926dc6efdedfe0016d by John Layt.
Committed on 08/05/2011 at 13:39.
Pushed by jlayt into branch 'master'.

KCM Locale: Add support for setting Week Number System

KDE previously only supported ISO Weeks, now it supports multiple
systems so allow the user to configure which they want.

Requires kdelibs revision b920149

FEATURE: 224351
FIXED-IN: 4.7.0

M  +69   -1    kcontrol/locale/kcmlocale.cpp     
M  +6    -0    kcontrol/locale/kcmlocale.h     
M  +82   -25   kcontrol/locale/kcmlocalewidget.ui     
M  +1    -0    l10n/C/entry.desktop     

http://commits.kde.org/kde-runtime/7fcbdbc0935b5919437f4e926dc6efdedfe0016d