roed314 / seminars

Listing of online math seminars
GNU Affero General Public License v3.0
41 stars 15 forks source link

display timezones as tooltips in embedded schedules #941

Closed robertylewis closed 7 months ago

robertylewis commented 9 months ago

This may not be the proper way to implement this -- feel free to reject this PR and consider this a feature request :smile: I don't have access to the development DB so it's not tested.

I noticed at https://leanprover-community.github.io/lt2024/schedule.html that the embedded schedule doesn't give any indication of the timezone. I've added text about this on the webpage, but it would be nice if hovering over a time gave a tooltip with the time zone. This is what I've tried to implement here, in the most basic way possible.

edgarcosta commented 9 months ago

LGTM, but I have not tested it

robertylewis commented 9 months ago

It was pointed out to me that the embedded schedule does not actually localize to the browser time zone: leanprover-community.github.io/lt2024/schedule.html shows up in EST for everyone. So I think this fix is probably not enough. Either the time zone should be more explicitly shown, or (preferably) something needs to be done to make it actually localize. I doubt I could figure out how to do the latter myself.

edgarcosta commented 9 months ago

Here is a workaround:

<div class="embeddable_schedule" shortname="LeanTogether2024" daterange="future"></div>
<script src="https://researchseminars.org/embed_seminars.js" onload="document.getElementsByClassName('embeddable_schedule')[0].setAttribute('timezone',Intl.DateTimeFormat().resolvedOptions().timeZone);seminarEmbedder.initialize({'addCSS': true});"></script>
edgarcosta commented 9 months ago

@roed314 do you agree with the timezone tooltips?

robertylewis commented 9 months ago

@edgarcosta Thanks! The workaround seems to work great.

edgarcosta commented 8 months ago

Here is how it would show:

Screen Shot 2023-12-18 at 09 53 58

maybe is a bit confusing given "Times in America/New York (now UTC -5)" just above