set timezone
This commit is contained in:
parent
26de3376d2
commit
d882428cc0
|
@ -425,6 +425,9 @@ class OmnipodDashManagerImpl @Inject constructor(
|
|||
observeConnectToPod,
|
||||
observeSendProgramBasalCommand(basalProgram, hasBasalBeepEnabled)
|
||||
)
|
||||
.doOnComplete {
|
||||
podStateManager.timeZone = TimeZone.getDefault()
|
||||
}
|
||||
// TODO these would be common for any observable returned in a public function in this class
|
||||
.doOnNext(PodEventInterceptor())
|
||||
.doOnError(ErrorInterceptor())
|
||||
|
|
|
@ -35,7 +35,7 @@ interface OmnipodDashPodStateManager {
|
|||
val isPodKaput: Boolean
|
||||
var bluetoothConnectionState: BluetoothConnectionState
|
||||
|
||||
var timeZone: String
|
||||
var timeZone: TimeZone
|
||||
val lastUpdatedSystem: Long // System.currentTimeMillis()
|
||||
val lastStatusResponseReceived: Long
|
||||
val time: DateTime?
|
||||
|
|
|
@ -99,10 +99,10 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
override var timeZone: String
|
||||
get() = podState.timeZone
|
||||
override var timeZone: TimeZone
|
||||
get() = TimeZone.getTimeZone(podState.timeZone)
|
||||
set(tz) {
|
||||
podState.timeZone = tz
|
||||
podState.timeZone = tz.getDisplayName(true, TimeZone.SHORT)
|
||||
store()
|
||||
}
|
||||
|
||||
|
|
|
@ -608,7 +608,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
|
|||
// // return getSafe(() -> podState.getTimeZone());
|
||||
// return podStateManager.timeZone
|
||||
// }
|
||||
private fun getTimeZone(): String {
|
||||
private fun getTimeZone(): TimeZone {
|
||||
// Return timezone ID (e.g "Europe/Amsterdam")
|
||||
return podStateManager.timeZone
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue