Skip to content

Commit 2d2857c

Browse files
authored
Better handling of circumpolar always light conditions (#42)
1 parent c3c4001 commit 2d2857c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SunKit/Sun.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ public class Sun {
607607
var sunriseSeconds = (Int(sunriseUTCMinutes) * 60) + timeZoneInSeconds
608608
let startOfDay = calendar.startOfDay(for: date)
609609

610-
if sunriseSeconds < 0 {
610+
if sunriseSeconds < Int(SECONDS_IN_ONE_HOUR) {
611611
sunriseSeconds = 0
612612
}
613613

@@ -658,7 +658,7 @@ public class Sun {
658658

659659
secondsForSunToReachElevation = Double(SECONDS_IN_ONE_DAY)
660660
}
661-
else if (secondsForSunToReachElevation < 0){
661+
else if (secondsForSunToReachElevation < SECONDS_IN_ONE_HOUR){
662662

663663
secondsForSunToReachElevation = 0
664664
}

0 commit comments

Comments
 (0)