Skip to content

Commit

Permalink
Better handling of circumpolar always light conditions (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
davideilmito authored May 13, 2023
1 parent c3c4001 commit 2d2857c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SunKit/Sun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ public class Sun {
var sunriseSeconds = (Int(sunriseUTCMinutes) * 60) + timeZoneInSeconds
let startOfDay = calendar.startOfDay(for: date)

if sunriseSeconds < 0 {
if sunriseSeconds < Int(SECONDS_IN_ONE_HOUR) {
sunriseSeconds = 0
}

Expand Down Expand Up @@ -658,7 +658,7 @@ public class Sun {

secondsForSunToReachElevation = Double(SECONDS_IN_ONE_DAY)
}
else if (secondsForSunToReachElevation < 0){
else if (secondsForSunToReachElevation < SECONDS_IN_ONE_HOUR){

secondsForSunToReachElevation = 0
}
Expand Down

0 comments on commit 2d2857c

Please sign in to comment.