Bug 349044 - Week number is off-by-one in Plasma Calendar
Summary: Week number is off-by-one in Plasma Calendar
Alias: None
Product: plasmashell
Classification: Plasma
Component: Calendar (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Martin Klapetek
Depends on:
Reported: 2015-06-11 22:34 UTC by Sebastian Kügler
Modified: 2015-06-12 04:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.11


Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Kügler 2015-06-11 22:34:49 UTC
The week number displayed is off by one on my system. We're currently in week 24, calendar displays week 23. (It's 11th June, and my locale is LC_ALL=en_US.UTF8.)

In a shell this display the right number (24):
date +%V

Python also gets it right:
>>> import datetime
>>> datetime.date.today().isocalendar()[1]

Reproducible: Always
Comment 1 Martin Klapetek 2015-06-11 22:47:00 UTC
Ah, interesting. This is indeed the case for locales starting the week with Sunday.

Comment 2 Martin Klapetek 2015-06-11 23:11:25 UTC
Git commit bc0280ddb0b1333aee1a8bc0322ba61327ef015a by Martin Klapetek.
Committed on 11/06/2015 at 23:11.
Pushed by mklapetek into branch 'master'.

[calendar] Always start counting weeks from Monday

Sometimes the first day in the grid can be Sunday, but the week number
must always be counted from Monday in that week
Change-Id: I903650fcaadb4fd78764ad6a8bb1e219261c791b
FIXED-IN: 5.11

M  +13   -1    src/declarativeimports/calendar/calendar.cpp

Comment 3 Sebastian Kügler 2015-06-12 04:23:32 UTC
*confirms fixed*

Thanks Martin!