tinacms / tina.io

Website for TinaCMS šŸ¦™ - General info, documentation, blogs & contribution guidelines.
https://tina.io
245 stars 1.59k forks source link

šŸ› Event Component ā€“ Inconsistencies in the Date Depending on Local Machine! #2129

Closed isaaclombardssw closed 1 week ago

isaaclombardssw commented 3 weeks ago

šŸ› Describe the Bug

It was identified (@bradystroud) that event component dates set by the Tina UI were being converted to UTC from the entered time (i.e. probably Australian time). They then get converted back on render to the users local time (such that two people might have different displayed dates and the chip marking the event as "live" or "done" may be inaccurate and the dates might differ from the event website).

At the same time (11am on Friday, Aug the 30th AEST)

šŸŽÆ Expected Behaviour

We have some options...

As an example, we are gonna use Copenhagen ā€“ finishes on 30th at 6pm

Option 1 ā€“ user enters event datetime in event timezone (enter 30th at 6pm) Easiest for users āœ… Users will save the date + time they see on the events website ā€“ no maths phew

E.g. if the website says the event finishes at 30th 6pm, that is what they enter, regardless of where they are. They will also enter a datetime offset from UTC to the events timezone (e.g. Copenhagen +2 hrs)

Option 1.5 ā€“ Option 1 but no timezone field use magic to get timezone from location

Option 2 ā€“ Enter (31st at 4am) āŒ Seth doing maths ā€“ not good, risky bizness

Option 3 ā€“ enter raw string, not date No maths for anyone How will we do the DONE/LIVE indicator?

- Brady

šŸ’¼ Tasks

āž• More Information

As for the implementation ā€“ currently (suspected), when users enter a date it will be converted from their local time to UTC. When rendering the page, the stored UTC time is converted to their local time, and local time is used for comparison. No indication to users of what to enter, outside of "start date" and "end date".

Cc:

isaaclombardssw commented 2 weeks ago

Done, to be reviewed as per #2147

isaaclombardssw commented 1 week ago

Implemented, but extra TinaCMS fields can be made better ā€“ https://github.com/tinacms/tina.io/issues/2173