sydevs / WeMeditate

International website promoting the practice of meditation, with online resources and free local classes.
https://www.wemeditate.com
5 stars 7 forks source link

Live meditations - adjust the time to the browsers' timezone #159

Open artemarta opened 1 year ago

artemarta commented 1 year ago

Addresses the #157 issue.

Ardnived commented 1 year ago

Hi @artemarta, thanks so much for taking a look at this. Sorry for taking so long to reply, I only just noticed this PR! Feel free to @ tag me on any future comments.

The change you made is related to the countdown though, which I think is actually accurate. The part which is confusing for users is the part which I've circled in this screenshot.

Screenshot 2022-12-10 at 14 15 44

That bit of text is defined through the CMS, so it's not straightforward to extract. But perhaps we could insert a little bit of text just above the countdown which says "STARTS AT 7PM GMT". And then replace 7PM GMT with whatever the local start time would be. And then we can remove "Starting at 7pm GMT" from the CMS.

This is where that text would be inserted. https://github.com/sydevs/WeMeditate/blob/f7e6556592f02c9ba944e0907d4dda096862f5b4/app/views/content_blocks/custom_splash/_streams.html.slim#L29-L42

You could add something like

.cb-splash-textbox__time
    | Starts at
    span.js-local-time data-time=(record.next_stream_time.to_f * 1000)

And then use javascript to find .js-local-time and replace it's contents with the dataset.time attribute converted to local time.