code4recovery / tsml-ui

Embeddable recovery meeting finder
https://tsml-ui.code4recovery.org/
MIT License
23 stars 17 forks source link

Meetings not displaying in visitor's timezone #318

Closed jeznag closed 1 year ago

jeznag commented 1 year ago

Thanks heaps for the hard work on tsml-ui. It looks perfect for our use case (an Australia wide meeting list for DA).

I saw that https://github.com/code4recovery/tsml-ui/issues/93 was closed but it doesn't seem to work the way I'd expect.

I've configured tsml-ui to use Sydney time but it still shows Perth meetings in Perth time.

CleanShot 2023-07-20 at 19 01 06

If I click on the Perth meeting, it shows both timezones but in a confusing way. No-one in Australia would understand what GMT+8 vs GMT+10 means.

CleanShot 2023-07-20 at 19 01 40

Steps to replicate:

<div id="tsml-ui" data-src="https://sheets.code4recovery.org/storage/1YRpUph8Xfw-hX-2IegFx_S4YQUprFTqLPYxfL42Pb98.json" data-mapbox="pk.eyJ1IjoiZGFhdXNpbnRlcmdyb3VwIiwiYSI6ImNsaTVvc2VicjFpYmszcm8wbXp0ZmFpcnIifQ.Jo3HdrcE5_r0EBU-DiTP1Q" data-timezone="Australia/Sydney"></div>

Here is my spreadsheet: https://docs.google.com/spreadsheets/d/1YRpUph8Xfw-hX-2IegFx_S4YQUprFTqLPYxfL42Pb98/edit#gid=0

joshreisner commented 1 year ago

hey @jeznag that's great you're trying out these time zone features

i'm not able to completely reproduce the issues you were seeing - i think you might have been trying with and without the data-timezone param? anyway i would take that out so the timezones should be translated in the user's timezone

here's an example i'm using: https://tsml-ui.code4recovery.org/tests/timezones.html - it gets data from https://docs.google.com/spreadsheets/d/1ILXvx4P0YoceEYiLL-TghfpaQPnyESWHnbKqvn-eQbk/edit#gid=0 - you should have edit access to feel free to edit things and try it out. it's hooked up to TSML UI directly so no need to refresh the sheets URL

here's what i see (it's thursday morning for me on the USA west coast) timezones

timezones are translated on the home page into my timezone - i'm not sure why that wasn't happening for you but i would try it again

on the inside page there was a bug, and for me it was duplicating the same time twice. this is no longer happening for me. again not sure why that wasn't happening for you

Screenshot 2023-07-20 at 6 49 50 AM

regarding the shortened time zone, this is a little bit tricky. we use a library called luxon which shows the abbreviation for us, and this in turn relies on something else. more info here: https://stackoverflow.com/questions/62019992/detect-timezone-abbreviation-using-luxon -- anyway i just made a change that should fix the issue for you if your browser is using en-AU as your language. if i switch my browser language to that, i see AEST for the australian timezone (and i lose PDT from my own):

Screenshot 2023-07-20 at 6 53 59 AM
joshreisner commented 1 year ago

oops yes there was a bug here when data-timezone is specified - it was not normalizing other timezones to that zone. i would still remove data-timezone for your use-case but the bug should be fixed now Screenshot 2023-07-20 at 07-11-20 Meetings

Screenshot 2023-07-20 at 7 11 40 AM