Upgraded. pre-existing calendar events shifted from local time to UTC

AI-generated summary

After upgrading, tkforbes noticed that pre-existing calendar events in their Discourse instance shifted from local time to UTC, significantly impacting their community. tkforbes provided screenshots and details about the issue, including an event that was defined as 9am-5:30pm but displayed as 2:00 PM-10:30 PM.

supermathie requested the raw post where the event was defined, and tkforbes explained that the event times were displaying as UTC, but clicking or hovering the event showed the correct times. tkforbes also reported inconsistent behavior, with some events showing local time and others showing UTC time.

tkforbes provided the event code, and supermathie suggested that the posts might need a rebake. joffreyjaffeux acknowledged the issue with local dates not being applied to the calendar and planned to fix it in the near future.

Later, tkforbes confirmed that a rebake did result in an update, and tkforbes noted that refreshing the page could also correct the issue. However, navigating from the Upcoming Events calendar to the event still gave incorrect times. joffreyjaffeux mentioned that a fix had been pushed a few days ago, which should resolve the issue.

I ran ./laucher app rebuild this morning (there are other ways to upgrade too, like the GUI).

This is the current detail given on the Admin page.

My Discourse has a very active calendar. All the pre-defined event start and end times reset from local time to UTC. That has a significant impact on my community.

That event was defined as 9am → 5:30pm.

Can you show us the raw for that post where the event is defined?

Actually, the event is just displaying event times as UTC. Clicking (or perhaps hovering) the event shows this.

Very weird. I’ve now seen a variety of cases:

  1. As another user, the event visited shows local time.
  2. As admin, an event was UTC. Refreshed. Event updated to local time.
  3. As admin, chose another event. Local time shown.
  4. As admin, that Dec 22 event still showing as UTC.
  5. As another user, that Dec 22 event displaying as local time.

I’m glad I have a screenshot or I’d think I was going crazy.

[event start="2024-12-22 09:00" status="standalone" timezone="America/Toronto" end="2024-12-22 17:30" reminders="bumpTopic.3.days" allowedGroups="trust_level_0"]
[/event]

At a guess, these posts probably needed a rebake and your server is working through them and rebaking them with updated formatting.

On a post that still looks “wrong”, if you force a rebake:

does it look right?

I’m too late. I refreshed the page of my example and the event updated to local time.

If I find another problem event, I’ll try your suggestion.

I will add that my update was complete more than 5 hours ago. It’s not a big site. It’s also not a powerful server, but it is adequate.

This is a problem with local dates, sometimes they are not applied to the calendar, we are aware, I will try to fix this in the near future.

2 Likes

I can now confirm that a rebake did result in an update.

As admin, I found this event…

and then used the Rebuild HTML option and had this result…

1 Like

The Rebuild HTML option doesn’t seem to be necessary. I can get a corrected result just by refreshing the page. It’s annoying though, because navigating from the Upcoming Events calendar to the event does give me the incorrect times. Members expect to see a reliable result every time.

I don’t think I’ve found a case of incorrectly displayed times for any user other than admin.

I pushed a fix few days ago which should fix this:

https://github.com/discourse/discourse-calendar/commit/46c93b81f025bdea343308ba4034da37b725daa8

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.