From a8fe9dafa7abc99490bda842e4062e08faaf70f5 Mon Sep 17 00:00:00 2001 From: ivar Date: Mon, 23 Mar 2026 16:38:37 +0100 Subject: chore: add SolvervDef stub methods for widget integration --- Solsnu.Widget/Solsnu_Widget.swift | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'Solsnu.Widget') diff --git a/Solsnu.Widget/Solsnu_Widget.swift b/Solsnu.Widget/Solsnu_Widget.swift index bd71672..1021db1 100644 --- a/Solsnu.Widget/Solsnu_Widget.swift +++ b/Solsnu.Widget/Solsnu_Widget.swift @@ -106,11 +106,11 @@ struct Solsnu_Widget: Widget { struct SolvervDef { let date: Date; - + init(date:Date) { self.date = date; } - + init(utcString:String) { let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd HH:mm:ss" @@ -119,7 +119,7 @@ struct SolvervDef { let date = formatter.date(from: utcString)! self.date = date } - + func emoji() -> String { let components = Calendar.current.dateComponents([.year,.month,.day,.hour,.minute], from: date) let hour = components.hour! @@ -131,3 +131,22 @@ struct SolvervDef { } } } + +extension SolvervDef { + var season: String { + // Will be fully implemented in Task 7 + return "winter" + } + + func daysUntilNext() -> Int { + return 0 + } + + func progressRatio() -> Double { + return 0.0 + } + + func upcomingEventsPreview(count: Int) -> [String] { + return [] + } +} -- cgit v1.3