Broham / suncalcPy

A python implementation of the SunCalc javascript library.
MIT License
41 stars 18 forks source link

Moonset if Hour is 0 then it should be the next day #6

Open DragonflyNet67 opened 4 years ago

DragonflyNet67 commented 4 years ago

First of all thank you for this cool and short routine to determine sun and moon data. I noticed, that the moon-set date remains on the same day if it is after midnight. I think the date should be one day later (add 1 day to date). I added following to the getMoonTimes method almost at the end (where if (sett): is): def getMoonTimes(date, lat, lng):

   if (sett):

       if int(sett) == 0:

           sett +=24

   result["set"] = hoursLater(t, sett)