chiyadev / genshin-schedule

🕑 Genshin farming scheduler
https://genshin.chiya.dev
MIT License
72 stars 17 forks source link

Feature Request: More Specific Time and Time Zones #1

Closed ImmortalZypther closed 3 years ago

ImmortalZypther commented 3 years ago

Hello! I love this project, but had 2 small requests.

1: More time zones. The current one for "America" is ahead by 1 hour for me, which is a small inconvenience but I hope it can be edited in the future.

2: More specific time. Right now, the resin regeneration estimate says 120 in 16 hours no matter how long it actually will take to get the resin to 120. While this is technically true, it'd be useful to have the 120 resin time estimate change dynamically just like every other estimate.

It'd also be useful to know what time in the timezone selected would be the time the resin is fully regenerated. For example, it'd still say "120 in 12 hours" for those who are fine with doing the mental math but it'd also say "120 at XX:XX" in a single line below it.

Thank you for making this website! It's super useful.

luaneko commented 3 years ago

1:

The website should display the time for GMT-5 which is the server time for Genshin's "America" server. It either means your browser's timezone is GMT-6, or it's a Javascript date error (very very unlikely).

This code https://github.com/chiyadev/genshin-schedule/blob/master/src/time.tsx#L32 is responsible for time calculation. Please let me know if there is an error.

2:

Sure, that sounds feasible!

ImmortalZypther commented 3 years ago

I think the server just has a single time zone and doesn't account for the multiple time zones in America. I did some random testing on my browser with getHours() + getMinutes() and both were accurate to the time on my computer currently. Nothing looks wrong with your code either, so it seems that Genshin might just be an hour off instead.

luaneko commented 3 years ago

How about like this? Rather than adding another line, I think keeping it simple and showing the time in brackets is ok.

image

ImmortalZypther commented 3 years ago

Looks and sounds good to me!

luaneko commented 3 years ago

Implemented!

ImmortalZypther commented 3 years ago

I believe the reason the website's time was wrong is because it didn't account for DST being ahead 1 hour. Ever since DST turned the hour back, the website has been accurate to my computer's clock along with my phone's clock.