Event shows two different starttimes when timezone is null #63

Open
opened 2024-03-08 16:13:20 +01:00 by cvu · 5 comments
Collaborator

the time above (18:00) and below (17:00) do not match.

the time above (18:00) and below (17:00) do not match.
cvu added the
bug
label 2024-03-08 16:13:20 +01:00
Owner

I can reproduce it with this event

I can reproduce it with [this event](https://cottbus.vonunten.org/events/039f2ea7-fca2-4817-bd3c-416de2f5bc73)
778a69cd added the
upstream
label 2024-03-08 17:43:33 +01:00
778a69cd changed title from Different Start Times to Event shows two different starttimes when timezone is null 2024-04-05 18:30:06 +02:00
Owner

So I continued looking into this issue and the way Mobilizon handles timezones is just a huge mess.

For once, there is inconsistent rendering of datetimes in the StartTimeIcon and the EventFullDate component, that seems to only show when the timezone of an event in the event_options field is null. The StartTimeIcon is actually correct here, assuming that null = UTC, but a quick survey shows that users seem to enter their date wrongly as Europe/Berlin, even though timezone remains null.

A complete fix of timezone handling would probably require changes to the database schema, not looking forward to do that.

But there are few tweaks we can do ourselves:

  • We can write a script to change all timezone fields of existing events in the db to Europe/Berlin. This would also touch the begins_on and ends_on fields.
  • We can change the timezone field in table user_settings for all existing users from null to Europe/Berlin. This would at least make events that are created by existing users in the future work.

Don't really know how to fix this for newly created users creating new events tho, except for running these scripts again and again.

So I continued looking into this issue and the way Mobilizon handles timezones is just a huge mess. For once, there is inconsistent rendering of datetimes in the `StartTimeIcon` and the `EventFullDate` component, that seems to only show when the timezone of an event in the `event_options` field is `null`. The StartTimeIcon is actually correct here, assuming that `null` = UTC, but a quick survey shows that users seem to enter their date wrongly as Europe/Berlin, even though timezone remains null. A complete fix of timezone handling would probably require changes to the database schema, not looking forward to do that. But there are few tweaks we can do ourselves: - We can write a script to change all timezone fields of existing `events` in the db to Europe/Berlin. This would also touch the `begins_on` and `ends_on` fields. - We can change the `timezone` field in table `user_settings` for all existing users from `null` to `Europe/Berlin`. This would at least make events that are created by existing users in the future work. Don't really know how to fix this for newly created users creating new events tho, except for running these scripts again and again.
Owner

I just defaulted the timezone for all existing users to Europe/Berlin:

UPDATE user_settings SET timezone = 'Europe/Berlin' WHERE timezone IS NULL;

Not a solution, but should make the current problem a lot less impactful.

I just defaulted the timezone for all existing users to `Europe/Berlin`: ``` UPDATE user_settings SET timezone = 'Europe/Berlin' WHERE timezone IS NULL; ``` Not a solution, but should make the current problem a lot less impactful.
Owner

We added a fix that should at least make the situation bearable, when the timezone of the creator and the viewer both isn't null, but only conflicting. The old default was to show the creators timezone, now we show the viewers timezone by default.

We added a fix that should at least make the situation bearable, when the timezone of the creator and the viewer both isn't null, but only conflicting. The old default was to show the creators timezone, now we show the viewers timezone by default.
cvu closed this issue 2024-08-19 14:19:51 +02:00
Owner

The hard issue (when timezone is null) still persists, but the impact should be way less now.

The hard issue (when timezone is null) still persists, but the impact should be way less now.
778a69cd reopened this issue 2024-08-31 20:04:26 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: potsda.mn/mobilizon#63
No description provided.