Ask / Submit
5

[bug] problem with week numbers in calendar in the US & indian locale

asked 2017-01-06 20:03:15 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2017-01-07 16:51:19 +0300

misc11 gravatar image

steps to reproduce

  1. have language set to "English (US)" (en_US) or an indian language
  2. open jolla calendar app
  3. look at week number of december 2016, january 2017 and february 2017

what happens

  • last week of december 2016 is week number 52
  • first week of january 2017 is week number 52 too => week 52 is duplicate
  • last week of january 2017 is week number 4
  • first week of february 2017 is week numer 6 => week 5 is skipped

image description

what is expected

correct week numbers for january 2017 like in en_UK

image description

tested for

  • SFOS 2.0.5.6
  • Jolla 1
edit retag flag offensive close delete

Comments

@Telamon i can confirm that behavior! also week 52 of 2006 is duplicate (last week of dec 2016 and first week of jan 2017)

i can also say that according to ISO 8601 (which defines the numbering of the weeks):

  • week 4: from 2017-01-23 (2017-W04-1) to 2017-01-29 (2017-W04-7)
  • week 5: from 2017-01-30 (2017-W05-1) to 2017-02-05 (2017-W05-7)
  • week 6: from 2017-02-06 (2017-W06-1) to 2017-02-10 (2017-W06-7)

i know that in the US the calendars are not aligned with the actual week (which starts according to ISO 8601 on monday!) so therefore the weeknumbers are only half-correct on US calendars anyway.

assuming that you want the number to be correct most of the time:

  • sunday of last week, mon-sat of the correct week number

then the numbering for february is correct and the january is shifted by one week! between the views of jan and feb the calendar is corrected

a funny bug! i bet its caused because americans misalign their calendar to the actual week... also just checked it appears to also happen in indian languages! i only tested one now but i guess its all of them

misc11 ( 2017-01-07 00:04:46 +0300 )edit

p.s. @Telamon also: welcome to TJC! :) and: theres really no need to make this a wiki. its a bug report, you found it, you get the karma :) next time...

misc11 ( 2017-01-07 00:08:45 +0300 )edit

Thanks for the confirmation and the welcoming message @misc11! Thus people living outside the realm of ISO 8601 are being deprived of week 5, but started the year with week 52. That's a compensation. :) I'm just starting using a Jolla, after my beloved N9 suddenly failed one month ago. I still have many things to learn, about the device itself and about the community!

Telamon ( 2017-01-07 00:30:44 +0300 )edit

@Telamon the funny thing is that week numbers are not defined outside the realm of ISO 8601, at least not that im aware of... or do you know a US standard or sth?

misc11 ( 2017-01-07 02:20:49 +0300 )edit

@Telamon i have changed your post a bit.... i hope thats ok :) since its a wiki anyway ;)

misc11 ( 2017-01-07 03:29:11 +0300 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-01-12 12:18:45 +0300

Pekka Vuorela gravatar image

I'm thinking of just removing the whole week number for locales having sunday as first day of a week. For en_US the US system for week numbers could be used, but when week numbers are from ISO-8601 a calendar grid row will have dates from two different weeks. Showing number from row starting day or majority of days will be both right and wrong, ending up just confusing. Objections?

edit flag offensive delete publish link more

Comments

I am not sure what you are suggesting but please don't touch the finnish calender week numbering because it works and I need it.

Beside the point, but I have always thought it totally braindead to have sunday as the first day of the week, what a crapload that is! Think about it a while, where this whole week thing comes from historically; "god created the world in 6 days, and on the 7th she rested..." That's the 7th, not the 1st, huh!!

juiceme ( 2017-01-13 07:56:47 +0300 )edit

Do whatever other calendars do - AOSP's calendar for example.

DaveRo ( 2017-01-13 09:30:30 +0300 )edit

As said, only talking about locales with sunday as first day. Finnish not included in that.

Pekka Vuorela ( 2017-01-13 10:19:18 +0300 )edit

I would second DaveRo. I cannot easily check AOSP's behavior, but I have looked at OSX's calendar: there is a switch in the preferences that enables the display of week numbers. And for the en_US locale, it follows the common US scheme, namely weeks start on Sunday and week 1 contain January 1st.

I guess that American users who wish iso8601 week numbers can always switch to en_UK (and have their weeks start on Monday).

Telamon ( 2017-01-13 13:12:16 +0300 )edit

Here on AOSP (OmniRom 4.4) there is a pref to display week number, and a pref for 'week starts on', options being Sat, Sun, Mon, or locale default (here=UK=Mon, en-US=my preference=Sun)

DaveRo ( 2017-01-13 13:29:46 +0300 )edit
Login/Signup to Answer

Question tools

Follow
1 follower

Stats

Asked: 2017-01-06 20:03:15 +0300

Seen: 243 times

Last updated: Jan 12