hebcal / hebcal-js

⛔️ DEPRECATED - a perpetual Jewish Calendar (JavaScript)
GNU General Public License v3.0
124 stars 40 forks source link

Sunrise and sunset are not exact #51

Closed avrAhituv closed 5 years ago

avrAhituv commented 6 years ago

Thank you very much, but i find a bug..

You use the suncalc library to calculate sunrise and sunset times. but times are not accurate, for example: today, 30-08-2018 the sunrise is: 06:13 in jerusalem as can be seen on the site yeshiva.org.il. sunris-yeshiva-site but the library tells me that time is 06:25.. sunrisejson

i see the suncalc calculate the sunrise like this: var times = SunCalc.times = [ [-0.833, 'sunrise', 'sunset' ], [ -0.3, 'sunriseEnd', 'sunsetStart' ], [ -6, 'dawn', 'dusk' ], [ -12, 'nauticalDawn', 'nauticalDusk'], [ -18, 'nightEnd', 'night' ], [ 6, 'goldenHourEnd', 'goldenHour' ] ]; and in order for me to get the right times, I have to run over the sunrise to -2.4 the same is true of sunset..

Who can help me?? Thanks!

Scimonster commented 5 years ago

I think there are differing opinions as to when sunrise/sunset get counted. You can try to add your time to suncalc's list, and then overwrite HDate.prototype.sunrise and sunset, so that Hebcal will calculate zmanim according to your adjustment.

Scimonster commented 5 years ago

On second thought, this is likely connected to #48, where latitude and longitude had gotten reversed and as such it was calculating for the wrong place.

Scimonster commented 5 years ago

Yep, seems to have been #48. Should be fixed now.

avrAhituv commented 5 years ago

I checked now, and it works fine! Thanks!!!