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 779346 - Week View: Incorrect starting day of the week in certain locales
Week View: Incorrect starting day of the week in certain locales
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-28 05:39 UTC by Joyjit Choudhury
Modified: 2017-03-02 10:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Weeks start with Sunday in locales with Monday as starting day (38.36 KB, image/png)
2017-02-28 05:39 UTC, Joyjit Choudhury
  Details
Patch for the bug (1.04 KB, patch)
2017-03-01 20:10 UTC, Gollapudi Vamsi Krishna
needs-work Details | Review
Week-view: the first weekday is set for week-header & week-grid (1.16 KB, patch)
2017-03-02 03:38 UTC, Joyjit Choudhury
committed Details | Review

Description Joyjit Choudhury 2017-02-28 05:39:24 UTC
Created attachment 346882 [details]
Weeks start with Sunday in locales with Monday as starting day

In locales where Monday is the starting day of the week, such as en_GB, the week view still displays Sunday as the first day. Which in turn results in Bug 777762 (https://bugzilla.gnome.org/show_bug.cgi?id=777762), where all days are off-by-one, such as 2nd Jan 2017 is shown to be a Sunday, whereas it should have been a Monday.
Comment 1 Gollapudi Vamsi Krishna 2017-02-28 13:24:59 UTC
I guess this is because of me.
Please set the first weekday of week header while you are setting the first weekday for week view. 
That should fix it :)
Comment 2 Jeremy Bicha 2017-03-01 19:43:40 UTC
Gollapudi, can you submit a patch for this?
Comment 3 Gollapudi Vamsi Krishna 2017-03-01 20:10:58 UTC
Created attachment 346995 [details] [review]
Patch for the bug

I think this should work, please check the patch.
Comment 4 Georges Basile Stavracas Neto 2017-03-01 20:47:18 UTC
Review of attachment 346995 [details] [review]:

The code is great, and the commit message is very good too - congratulations! Can you please also call gcal_week_grid_set_first_weekday() here? So we set both the header and the grid.

I'm marking this patch as 'needs-work' for you to put the Grid function there too, then we're good to go.

Thanks for working on that!
Comment 5 Joyjit Choudhury 2017-03-02 03:38:29 UTC
Created attachment 347016 [details] [review]
Week-view: the first weekday is set for week-header & week-grid

In this commit, the first weekday is set for week-header & week-grid.

The issue is, the first weekday is being set only for week-view,
resulting in incorrect display of weekdays in the week-header.

To fix this, the first weekday for week-header & week-grid is set
along with that of week-view.
Comment 6 Georges Basile Stavracas Neto 2017-03-02 10:22:04 UTC
Thanks for the patch. Pushed with a couple of nitpicks fixed (commit message, space after macros)