GNOME Bugzilla – Bug 780079
weekview: dates are off by an hour
Last modified: 2017-03-15 11:56:32 UTC
Created attachment 347987 [details] example of bug Two things actually: - 12 PM says 12 AM instead (but 00 correctly says 12 AM) - The entry is at 1 PM, but is rendered in the 12 PM slot
After investigating this issue, it turns out that the reason this happens is because the daylight time saving changed at 2am (instead of midnight, which is what should've happened). That leads to the question: how to communicate the user that a timezone changed in the middle of the week?
For the record, this is what I get here. When I start with: > '12-03-2017 00:00:00 -0800' (DST: NO) Then I add exactly 2 hours, and I get: > '12-03-2017 03:00:00 -0700' (DST: YES) Notice that the clock advanced 2 hours + switched the DST at 2am.
Created attachment 348001 [details] [review] week-grid: consider daylight when calculating event position There are some weird cases around the globe where the timezone changes in the middle of the day. In GMT-8:00, for example, the DST changes at 2:00 am. This makes the timezone of thestart of the week different from the event's timezone, and somehow the GLib API doesn't take that into account when calculating the diff between two dates. Fix that by also considering different timezones when calculating the event start and end positions.
Thanks for the report. Fixed in master. Attachment 348001 [details] pushed as d4ef9b2 - week-grid: consider daylight when calculating event position