File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
jvm/src/aws/smithy/kotlin/runtime/time
serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,13 @@ kotlin {
2222 implementation(libs.okio)
2323 // Coroutines' locking features are used in retry token bucket implementations
2424 api(libs.kotlinx.coroutines.core)
25+ implementation(libs.kotlinx.datetime)
2526 }
2627 }
2728
2829 nativeMain {
2930 dependencies {
3031 api(libs.crt.kotlin)
31- implementation(libs.kotlinx.datetime)
3232 }
3333 }
3434
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import kotlin.time.Duration
2525import kotlin.time.toKotlinDuration
2626import java.time.Duration as jtDuration
2727import java.time.Instant as jtInstant
28+ import kotlinx.datetime.Instant as KtInstant
2829
2930// FIXME Consider making this multiplatform (`common`) using kotlinx.datetime
3031public actual class Instant (internal val value : jtInstant) : Comparable<Instant> {
@@ -136,12 +137,12 @@ public actual class Instant(internal val value: jtInstant) : Comparable<Instant>
136137 /* *
137138 * Create an [Instant] with the minimum possible value
138139 */
139- public actual val MIN_VALUE : Instant = Instant (jtInstant. MIN )
140+ public actual val MIN_VALUE : Instant = fromEpochMilliseconds( KtInstant . DISTANT_PAST .toEpochMilliseconds() )
140141
141142 /* *
142143 * Create an [Instant] with the maximum possible value
143144 */
144- public actual val MAX_VALUE : Instant = Instant (jtInstant. MAX )
145+ public actual val MAX_VALUE : Instant = fromEpochMilliseconds( KtInstant . DISTANT_FUTURE .toEpochMilliseconds() )
145146 }
146147}
147148
Original file line number Diff line number Diff line change @@ -278,6 +278,7 @@ class CborSerializerTest {
278278 Instant .now() + 10 .days,
279279 Instant .now() + 365 .days,
280280 Instant .now() + 1825 .days,
281+ Instant .MAX_VALUE ,
281282 )
282283
283284 val serializer = CborSerializer ()
You can’t perform that action at this time.
0 commit comments