Skip to content

view: Fix daylight saving issue in week view

Daniel Garcia Moreno requested to merge danigm/gnome-calendar:daylight-482 into main

This patch fixes an issue when creating new events in week view the week after the daylight saving change.

The problem was in the calc of the selected date, that's done couting the 30 minutes slots and adding that minutes to the week_start datetime. When there's a daylight saving change, the real date to select should be adjusted. This patch adds a new util function to make it easy to add minutes ignoring the tz so we can make this calc directly with gcal_add_minutes_notz.

This also includes a new test file with some checks for the new util function and spring / autumn changes.

This new function could be used in other places to fix specific issues that could be caused by the same logic error, calculate a selection or event position based on GDateTime operations.

Fix #482 (closed)

Merge request reports