Skip to content

Commit

Permalink
Merge pull request #2 from yokotoka/master
Browse files Browse the repository at this point in the history
Fix corner case issue
  • Loading branch information
kstopa authored Sep 20, 2018
2 parents 019e355 + 92c2ca8 commit 91ea4ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions suntime/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ def _calc_sun_time(self, date=datetime.date.today(), isRiseTime=True, zenith=90.
hr += 1
min = 0

#10. check corner case https://github.com/SatAgro/suntime/issues/1
if hr == 24:
hr = 0
day += 1

return datetime.datetime(year, month, day, hr, int(min), tzinfo=tz.tzutc())

@staticmethod
Expand Down

0 comments on commit 91ea4ec

Please sign in to comment.