Bug 357470 - Pop-up calendar displays wrong week number for December 2020
Summary: Pop-up calendar displays wrong week number for December 2020
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Calendar widget (other bugs)
Version First Reported In: 5.5.1
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-03 14:38 UTC by Karl Ove Hufthammer
Modified: 2016-01-04 17:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2016-01-03 14:38:55 UTC
The calendar that pops up when one clicks the clock widget shows the week number of the last week in December 2020 as week 1. This is wrong. It should be week 53 (just like for December 2015, which *is* correctly displayed). Currently both the *last week* of 2020 and the *first week* of 2021 is shown as week 1.

Reproducible: Always

Steps to Reproduce:
1. Click the clock icon to show the calendar.
2. Click the current month name to zoom out and then the year number to zoom out further.
3. Click 2020 and the December.

Actual Results:  
The last week of December 2020 is shown as having week number 1.

Expected Results:  
The last week of December 2020 should be shown as having week number 53.

This problem may occur for other dates too; I have not done any extensive tests.

Note that having 1 as the week number for the week with the last day(s) of a year is not *necessarily* wrong. For example, the week number for this ‘last week’ is 1 for 2019, 53 for 2020 and 52 for 2021. (KDE displays the correct week number for 2019 and 2021.)

Information on calculation of the correct week numbers can be found at https://en.wikipedia.org/wiki/ISO_week_date

The correct calendar for 2020 can be seen at http://www.timeanddate.com/calendar/?year=2020

Or one may just use the command-line ‘cal’ utility included by default in most Linux distros. Here’s the command for showing December 2020 and January 2021:

cal -n2 -w 12 2020
Comment 1 Martin Klapetek 2016-01-04 03:38:24 UTC
Thanks for the report.

So turns out this is a bug in Qt; I can reproduce a simple
test case with 5.5.something.

I'll see if I can get anyone with Qt 5.6 reproduce with my
test case, if yes, then I'll file a bug upstream and post back
here.

Thanks again
Comment 2 Martin Klapetek 2016-01-04 17:05:01 UTC
There we go: https://bugreports.qt.io/browse/QTBUG-50273