diff options
Diffstat (limited to 'Solsnu.Widget/Solsnu_Widget.swift')
| -rw-r--r-- | Solsnu.Widget/Solsnu_Widget.swift | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Solsnu.Widget/Solsnu_Widget.swift b/Solsnu.Widget/Solsnu_Widget.swift index 20e8a8e..c36cc34 100644 --- a/Solsnu.Widget/Solsnu_Widget.swift +++ b/Solsnu.Widget/Solsnu_Widget.swift @@ -171,22 +171,22 @@ extension SolvervDef { } var nextEvent: SolsticeEvent? { - SolsticeData.shared.nextEvent() + SolsticeData.shared.nextEvent(from: date) } func daysUntilNext() -> Int { guard let next = nextEvent else { return 0 } - return next.daysUntil() + return next.daysUntil(from: date) } func progressRatio() -> Double { - guard let progress = SolsticeData.shared.progressToNextEvent() else { return 0.0 } + guard let progress = SolsticeData.shared.progressToNextEvent(from: date) else { return 0.0 } let ratio = Double(progress.elapsed) / Double(progress.total) return max(0, min(1.0, ratio)) } func upcomingEventsPreview(count: Int) -> [SolsticeEvent] { - SolsticeData.shared.upcomingEvents(count: count) + SolsticeData.shared.upcomingEvents(count: count, from: date) } static var preview: SolvervDef { |
