Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Localized Date on Match History #42

Open
robertvanhoesel opened this issue Feb 7, 2024 · 4 comments
Open

Use Localized Date on Match History #42

robertvanhoesel opened this issue Feb 7, 2024 · 4 comments
Labels
good first issue Good for newcomers

Comments

@robertvanhoesel
Copy link
Contributor

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.

@robertvanhoesel robertvanhoesel added the good first issue Good for newcomers label Feb 7, 2024
@reneklacan
Copy link
Member

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
Copy link
Contributor Author

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

  • Prints something sensical in SSR
  • Takes several formatting options like 'relative' (x ago), 'short' etc
  • Updates client side based in local machine time.

@reneklacan
Copy link
Member

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

@robertvanhoesel
Copy link
Contributor Author

Not needed. Also a ruby gem? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants