stormgateworld / web

Community Website with Leaderboards, Profiles and more for Stormgate.
https://stormgateworld.com
14 stars 9 forks source link

Use Localized Date on Match History #42

Open robertvanhoesel opened 7 months ago

robertvanhoesel commented 7 months ago

Create an Astro component that takes the UTC Date as argument and client side properly formats the date in local timezone. Note that Astro, doing Server Side Rendering too, will print the server time too. We need to think about a subtle way of updating the DOM.

Reference TimeAgo.astro for similar code.

reneklacan commented 7 months ago

In an ideal world, the solution would apply to relative time as well which would get autorefreshed as time goes on (1 minute ago -> 2 minutes ago)

robertvanhoesel commented 7 months ago

Hmm yeah probably we should just extend/rewrite to a <Date> component which:

reneklacan commented 7 months ago

Possible library to use https://www.npmjs.com/package/local-time

robertvanhoesel commented 7 months ago

Not needed. Also a ruby gem? 😅