Skip to content

Commit b610499

Browse files
committed
Update kotlinx-datetime to 0.6.1
Force millisecond timestamps for equality Kotlin/kotlinx-datetime#439
1 parent 6c3efd5 commit b610499

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

couchbase-lite/src/commonTest/kotlin/kotbase/DocumentTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ class DocumentTest : BaseDbTest() {
770770
fun testSetDate() {
771771
var mDoc = MutableDocument("doc1")
772772

773-
val date = Clock.System.now()
773+
val date = Clock.System.nowMillis()
774774
val dateStr = date.toStringMillis()
775775
assertTrue(dateStr.isNotEmpty())
776776
mDoc.setValue("date", date)

couchbase-lite/src/commonTest/kotlin/kotbase/JSONTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package kotbase
1717

18+
import kotbase.ext.nowMillis
1819
import kotlinx.datetime.Clock
1920
import kotlin.test.Test
2021
import kotlin.test.assertEquals
@@ -24,7 +25,7 @@ class JSONTest {
2425
// Verify that round trip String -> Date -> String doesn't alter the string (#1611)
2526
@Test
2627
fun testJSONDateRoundTrip() {
27-
val now = Clock.System.now()
28+
val now = Clock.System.nowMillis()
2829
// internally calls the relevant JSONUtils.toJSONString() and JSONUtils.toDate()
2930
val array = MutableArray()
3031
val dateStr = array.addDate(now).getString(0)

gradle/libs.versions.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" }
2929
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit" }
3030
kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version = "0.25.0" }
3131
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.9.0" }
32-
# kotlinx-datetime v0.6.0 introduces https://github.com/Kotlin/kotlinx-datetime/issues/439
33-
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.5.0" }
32+
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.6.1" }
3433
kotlinx-io = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version = "0.5.4" }
3534
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
3635
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }

0 commit comments

Comments
 (0)