set timezone

This commit is contained in:
Andrei Vereha 2021-06-25 19:45:38 +02:00
parent 26de3376d2
commit d882428cc0
4 changed files with 8 additions and 5 deletions

View file

@ -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())

View file

@ -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?

View file

@ -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()
}

View file

@ -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
}