summaryrefslogtreecommitdiffstats
path: root/Solsnu.Widget/Solsnu_Widget.swift
diff options
context:
space:
mode:
authorivar <i@oiee.no>2026-05-06 21:21:17 +0200
committerivar <i@oiee.no>2026-05-06 21:21:17 +0200
commit54dd55db8c19667939536e18535ac9c45817e442 (patch)
tree7ccb609b16e731c6281aa8d23969fb51c42eb60f /Solsnu.Widget/Solsnu_Widget.swift
parentefae4d08083f454975f08a2c0c6871c6a3d41e95 (diff)
downloadsolverv-54dd55db8c19667939536e18535ac9c45817e442.tar.xz
solverv-54dd55db8c19667939536e18535ac9c45817e442.zip
refactor: remove duplicate source files now served from Shared/
Diffstat (limited to 'Solsnu.Widget/Solsnu_Widget.swift')
-rw-r--r--Solsnu.Widget/Solsnu_Widget.swift8
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 {