Add last date for storage
This commit is contained in:
parent
0f2246cbe5
commit
ab64dac7fc
@ -11,6 +11,18 @@ final class TemperatureStorage: ObservableObject {
|
|||||||
in: .userDomainMask,
|
in: .userDomainMask,
|
||||||
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]
|
||||||
|
Loading…
Reference in New Issue
Block a user