diff --git a/TempTrack/Storage/TemperatureStorage.swift b/TempTrack/Storage/TemperatureStorage.swift index fb01e1b..694329d 100644 --- a/TempTrack/Storage/TemperatureStorage.swift +++ b/TempTrack/Storage/TemperatureStorage.swift @@ -11,6 +11,18 @@ final class TemperatureStorage: ObservableObject { in: .userDomainMask, appropriateFor: nil, create: true) } + + @AppStorage("newestDate") + private var newestMeasurementTime: Int = 0 + + private var newestMeasurementDate: Date { + get { + Date(seconds: newestMeasurementTime) + } + set { + newestMeasurementTime = newValue.seconds + } + } @Published var recentMeasurements: [TemperatureMeasurement]