PlasmaPy / plasmapy.github.io

PlasmaPy Website
https://www.plasmapy.org
Other
16 stars 22 forks source link

Make #110 display user's timezone calendar #111

Open StanczakDominik opened 3 years ago

StanczakDominik commented 3 years ago

Erik's embed in #110 is basically

https://calendar.google.com/calendar/embed?height=300&wkst=1&bgcolor=%23ffffff&ctz=America%2FLos_Angeles&src=Y19zcXFxMzkwczI0ampmanAzcTg2cHY0MXBpOEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t&color=%2354bfbf&showTitle=1&showNav=1&mode=MONTH&showTabs=1&showCalendars=0&showPrint=0&showDate=1

But suppose we e.g. had a piece of javascript that did this dynamically, using maybe something like https://stackoverflow.com/questions/1091372/getting-the-clients-time-zone-and-offset-in-javascript, then generated that embed dynamically?

Anyone know javascript?

zorjo commented 2 years ago

Maybe something like console.log(Intl.DateTimeFormat().resolvedOptions().timeZone.replace("/","%2F")) would be used in place of ctz and the other part can be concateneted?

StanczakDominik commented 2 years ago

Could be! Wanna give it a try? :)

zorjo commented 2 years ago

I just sent over a pull request for you folks! Hope it helps. #115

Bodasaieswar commented 1 month ago

if it is still open., i can work on it