From a16d5f726c987641f78500e0004ff7ff028eb716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Tue, 30 Jan 2024 20:29:34 +0100 Subject: [PATCH] More readable zoneId creation Change-Id: I912dc021554e4886a5d09e63799aa5c81e8fd16a --- .../samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt index 04b2ef352..99613d0f6 100644 --- a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt +++ b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt @@ -37,6 +37,7 @@ import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.shareIn import java.time.ZoneId +import java.util.TimeZone import javax.inject.Inject import javax.inject.Singleton @@ -72,6 +73,7 @@ internal class TimeZoneBroadcastMonitor @Inject constructor( intent.getStringExtra(Intent.EXTRA_TIMEZONE)?.let { zoneId -> // We need to convert it from java.util.Timezone to java.time.ZoneId ZoneId.of(zoneId, ZoneId.SHORT_IDS) + TimeZone.getTimeZone(zoneId).toZoneId() } }