From eb0b29baf20d984359c1d3b55e9efcd7ad866597 Mon Sep 17 00:00:00 2001 From: crc-32 Date: Wed, 3 Jul 2024 02:52:12 +0100 Subject: [PATCH] convert calendar pin timestamp correctly --- .../cobble/shared/domain/timeline/WatchTimelineSyncer.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/shared/src/commonMain/kotlin/io/rebble/cobble/shared/domain/timeline/WatchTimelineSyncer.kt b/android/shared/src/commonMain/kotlin/io/rebble/cobble/shared/domain/timeline/WatchTimelineSyncer.kt index 0a686675..ff832f35 100644 --- a/android/shared/src/commonMain/kotlin/io/rebble/cobble/shared/domain/timeline/WatchTimelineSyncer.kt +++ b/android/shared/src/commonMain/kotlin/io/rebble/cobble/shared/domain/timeline/WatchTimelineSyncer.kt @@ -24,6 +24,7 @@ import kotlin.math.round import kotlin.random.Random import kotlin.time.Duration import kotlin.time.Duration.Companion.days +import kotlin.time.Duration.Companion.milliseconds @ExperimentalUnsignedTypes class WatchTimelineSyncer( @@ -160,7 +161,7 @@ class WatchTimelineSyncer( val timelineItem = TimelineItem( pin.itemId, pin.parentId, - round(pin.timestamp.toEpochMilliseconds() / 1000f).toUInt(), + pin.timestamp.toEpochMilliseconds().milliseconds.inWholeSeconds.toUInt(), pin.duration?.toUShort() ?: 0u, TimelineItem.Type.Pin, TimelineItem.Flag.makeFlags(flags),