udivankin / sunrise-sunset

Sunrise and sunset time calculation for given coordinates. ~1kb minified with zero dependencies.
74 stars 17 forks source link

Calculated sunset is 17 hours early. #2

Closed Soundvessel closed 5 years ago

Soundvessel commented 5 years ago

Sunset today in Phoenix, Arizona is 6:27 PM.

This module is instead returning Mon Mar 04 2019 01:27:28 GMT-0700 (Mountain Standard Time)

I used the browser navigator code from the readme.

navigator.geolocation.getCurrentPosition(function(position) {
   console.log(getSunset(position.coords.latitude, position.coords.longitude));
});

Here is the positional information returned from navigator.geolocation.getCurrentPosition:

Position {coords: Coordinates, timestamp: 1551720924647}
coords: Coordinates
accuracy: 689
altitude: null
altitudeAccuracy: null
heading: null
latitude: 33.4400483
longitude: -112.0655335
speed: null
__proto__: Coordinates
timestamp: 1551720924647
__proto__: Position

Using the latest version of Google Chrome on Windows 10.

udivankin commented 5 years ago

Thanks for this report. I've merged a pull request recently that resolves this bug, pls check it.