Skip to content

Commit

Permalink
convert calendar pin timestamp correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed Jul 3, 2024
1 parent e8125a4 commit eb0b29b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit eb0b29b

Please sign in to comment.