RailsEventStore / rails_event_store

A Ruby implementation of an Event Store based on Active Record
http://railseventstore.org
MIT License
1.41k stars 121 forks source link

Browser timezone #1723

Closed casiodk closed 7 months ago

casiodk commented 8 months ago

Hi, I have an event with this timestamp

timestamp: "2024-01-10T15:00:08.168252+01:00"

But in the browser it shows as "10.01.2024, 14:00:08.168"

Is there any way to set the timezone in the browser app or have it show the time in the timezone and not UTC

mostlyobvious commented 7 months ago

Hi Nicolai!

All event timestamps transmitted to RES Browser are iso8601-formatted in UTC. The browser shows it as such, although formatted differently. The lack of clear indication what timezone is shown there already caused me a trouble a few times.

I think defaulting to show timestamps in local timezone makes a lot of sense. There's a web browser API to retrieve client timezone — Intl.DateTimeFormat().resolvedOptions().timeZone and I've managed to use it #1727 experiment.

mostlyobvious commented 7 months ago

Released v2.14.0 which includes Browser TZ improvements.

casiodk commented 5 months ago

@mostlyobvious This is not working in my browser. I am in copenhagen, but it shows the timezone in utc. Why not add an initializer where you can add the timezone? Screenshot 2024-03-12 at 11 13 49

Screenshot 2024-03-18 at 10 24 17