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

Weather API: sunrise & sunset timezone adjustment #266

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

simonrupf
Copy link

Noticed while using the StarField watchface that the sunrise & sunset times displayed didn't have their timezone adjusted.

As per https://openweathermap.org/current#fields_json these get provided in UTC, so this small patch applies the retrieved gmtOffset to them, before the UNIX epoch conversion.

Also deals with some minor tab issues in the area.

Alternative: If the internal gmtOffset could get exposed, in a getter or via making it a public or protected property, we could do such calculations in the watchface's code. It seemed cleaner to me to handle this within the library, as all exposed times otherwise seem to already be timezone adjusted, if I understood correctly.

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

Successfully merging this pull request may close these issues.

2 participants