Recurring events in Upcoming Events calendar fail to handle daylight saving change

AI-generated summary

A bug is reported where recurring events in the Upcoming Events calendar fail to handle daylight saving time changes correctly, causing events to shift by an hour. tshenry provides steps to reproduce the issue using a specific event markdown. j.jaffeux mentions a fix that should address this problem, and tshenry confirms that the fix resolves the issue.

It looks like when a recurring event crosses over from one daylight saving state to the other, the time of the event changes by an hour in the Upcoming Events calendar. This will happen even when the event and the user viewing the Upcoming Events calendar have matching timezones.

An easy way to reproduce this is to create an event topic with the following markdown (you may need to change the timezone value in the markdown to your own, or set your user’s timezone to America/Los_Angeles for the sake a reproducing the issue).

[event start="2024-11-01 10:00" status="public" name="Example" url="https://discourse.org" timezone="America/Los_Angeles" recurrence="every_week" minimal="true" end="2024-11-01 11:00"]
[/event]

Once you have created the event, go to /upcoming-events/week/2025/10/27 on your instance. The event will show at the correct time. If you move forward a week (the week daylight saving time ends), it shows the event as an hour earlier.

6 Likes

This should have been fixed as part of a bigger fix:

https://github.com/discourse/discourse/commit/249ae0009ac208ecf5c49dd29db8ded4d244fc75

I tested locally, but let me know if it doesnt work for you.

7 Likes

I can confirm that this fixes the issue :tada: Thanks Joffrey!