Add last date for storage

This commit is contained in:
Christoph Hagen 2023-06-09 07:06:51 +02:00
parent 0f2246cbe5
commit ab64dac7fc

View File

@ -12,6 +12,18 @@ final class TemperatureStorage: ObservableObject {
appropriateFor: nil, create: true) appropriateFor: nil, create: true)
} }
@AppStorage("newestDate")
private var newestMeasurementTime: Int = 0
private var newestMeasurementDate: Date {
get {
Date(seconds: newestMeasurementTime)
}
set {
newestMeasurementTime = newValue.seconds
}
}
@Published @Published
var recentMeasurements: [TemperatureMeasurement] var recentMeasurements: [TemperatureMeasurement]