GNOME Bugzilla – Bug 779331
Incorrect/Inconsistent week numbering in Week view
Last modified: 2017-03-16 23:34:03 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.
(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.
Created attachment 346881 [details] 7th Jan 2018 - 13th Jan 2018
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.
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.
Review of attachment 348036 [details] [review]: Looks good!
Thanks for the patch. Pushed to master.