Skip to content

Commit

Permalink
Simplified computed properties calculations (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
seldon1000 authored May 3, 2023
1 parent 3d82f43 commit 61dd5fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file not shown.
8 changes: 4 additions & 4 deletions Sources/SunKit/Sun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ public class Sun {

/// Returns True if we are in evening golden hour range
public var isEveningGoldenHour: Bool {
date.timeIntervalSince(eveningGoldenHourStart) >= 0 && eveningGoldenHourEnd.timeIntervalSince(date) >= 0
date >= eveningGoldenHourStart && date <= eveningGoldenHourEnd
}

/// Returns True if we are in morning golden hour range
public var isMorningGoldenHour: Bool {
date.timeIntervalSince(morningBlueHourStart) >= 0 && morningBlueHourEnd.timeIntervalSince(date) >= 0
date >= morningGoldenHourStart && date <= morningGoldenHourEnd
}

/// Returns True if we are in golden hour range
Expand All @@ -185,12 +185,12 @@ public class Sun {

/// Returns True if we are in evening blue hour range
public var isEveningBlueHour: Bool {
date.timeIntervalSince(eveningBlueHourStart) >= 0 && eveningBlueHourEnd.timeIntervalSince(date) >= 0
date >= eveningBlueHourStart && date <= eveningBlueHourEnd
}

/// Returns True if we are in morning blue hour range
public var isMorningBlueHour: Bool {
date.timeIntervalSince(morningBlueHourStart) >= 0 && morningBlueHourEnd.timeIntervalSince(date) >= 0
date >= morningBlueHourStart && date <= morningBlueHourEnd
}

/// Returns True if we are in blue hour range
Expand Down

0 comments on commit 61dd5fb

Please sign in to comment.