After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779331 - Incorrect/Inconsistent week numbering in Week view
Incorrect/Inconsistent week numbering in Week view
Status: RESOLVED FIXED
Product: gnome-calendar
Classification: Applications
Component: Views
3.23.x
Other Linux
: Normal normal
: 3.26
Assigned To: GNOME Calendar maintainers
GNOME Calendar maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-27 18:32 UTC by Joyjit Choudhury
Modified: 2017-03-16 23:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
1st Jan 2017(Sunday) - 7th Jan 2017(Saturday) (39.34 KB, image/png)
2017-02-27 18:32 UTC, Joyjit Choudhury
  Details
7th Jan 2018 - 13th Jan 2018 (38.73 KB, image/png)
2017-02-28 05:01 UTC, Joyjit Choudhury
  Details
Week-view: Set correct week number (2.57 KB, patch)
2017-03-15 19:38 UTC, Joyjit Choudhury
none Details | Review
Week-view: Set correct week number (2.86 KB, patch)
2017-03-15 21:23 UTC, Joyjit Choudhury
committed Details | Review

Description Joyjit Choudhury 2017-02-27 18:32:54 UTC
Created attachment 346858 [details]
1st Jan 2017(Sunday) - 7th Jan 2017(Saturday)

The week numbers in Week View is inconsistent and does not seem follow the ISO 8601(https://en.wikipedia.org/wiki/ISO_8601#Week_dates) or any other standards. In some cases, such as 1st Jan 2017(Sunday) - 7th Jan 2017(Saturday), it displays Week 52 (which should have been week 1). In other cases, for example 7th Jan 2018(Sunday) - 13th Jan 2018(Saturday), it's week 1, which should have been Week 2.
Comment 1 Mohammed Sadiq 2017-02-28 00:19:02 UTC
(In reply to Joyjit Choudhury from comment #0)
 > The week numbers in Week View is inconsistent and does not seem follow the
> ISO 8601(https://en.wikipedia.org/wiki/ISO_8601#Week_dates) or any other
> standards. In some cases, such as 1st Jan 2017(Sunday) - 7th Jan
> 2017(Saturday), it displays Week 52 (which should have been week 1). In
> other cases, for example 7th Jan 2018(Sunday) - 13th Jan 2018(Saturday),
> it's week 1, which should have been Week 2.

Hm.. Thats a nice catch. This may be caused by bug 777762, idk.
Comment 2 Joyjit Choudhury 2017-02-28 05:01:23 UTC
Created attachment 346881 [details]
7th Jan 2018 - 13th Jan 2018
Comment 3 Joyjit Choudhury 2017-03-15 19:38:58 UTC
Created attachment 348034 [details] [review]
Week-view: Set correct week number

In this commit, the correct week number is set in week-view.

The problem is, the week number is being set according to
the first day of the week (if the first and last day of the week
are in the same year), or the first and last day of the week
(if the first and last day are in different years).

To fix this, the week number is being set according to the middle day
of the week (according to ISO 8601 standards), resulting in correct
week numbers.
Comment 4 Joyjit Choudhury 2017-03-15 21:23:04 UTC
Created attachment 348036 [details] [review]
Week-view: Set correct week number

In this commit, the correct week number is set in week-view.

The problem is, the week number of week-view is being set according to
the first day of the week (if the first and last day of the week
are in the same year), or the first and last day of the week
(if the first and last day are in different years).

To fix this, the week number is being set according to the middle day
of the week (according to ISO 8601 standards), resulting in correct
week numbers.
Comment 5 Georges Basile Stavracas Neto 2017-03-16 23:33:20 UTC
Review of attachment 348036 [details] [review]:

Looks good!
Comment 6 Georges Basile Stavracas Neto 2017-03-16 23:33:59 UTC
Thanks for the patch. Pushed to master.