Dont use kotlinx datetime
This commit is contained in:
parent
4c97d691fc
commit
638fc5e71e
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="2.0.20" />
|
<option name="version" value="2.2.0" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@ -3,7 +3,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "ai.neuon.utility"
|
group = "ai.neuon.utility"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@ -12,7 +12,6 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.kotlinx.coroutines)
|
implementation(libs.kotlinx.coroutines)
|
||||||
implementation(libs.kotlinx.datetime)
|
|
||||||
implementation(libs.ktor.serialization.json)
|
implementation(libs.ktor.serialization.json)
|
||||||
implementation(libs.ktor.server.data.conversion)
|
implementation(libs.ktor.server.data.conversion)
|
||||||
implementation(libs.mongodb.bson)
|
implementation(libs.mongodb.bson)
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
package ai.neuon.utility.json
|
package ai.neuon.utility.json
|
||||||
|
|
||||||
import kotlinx.datetime.Instant
|
|
||||||
import kotlinx.serialization.json.*
|
import kotlinx.serialization.json.*
|
||||||
|
import kotlin.time.ExperimentalTime
|
||||||
|
import kotlin.time.Instant
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,6 +114,7 @@ fun JsonElement.asBooleanOrNull(): Boolean? {
|
|||||||
/**
|
/**
|
||||||
* @throws IllegalArgumentException if the current element is not a valid ISO 8601 [String]
|
* @throws IllegalArgumentException if the current element is not a valid ISO 8601 [String]
|
||||||
*/
|
*/
|
||||||
|
@OptIn(ExperimentalTime::class)
|
||||||
fun JsonElement.asInstant(): Instant {
|
fun JsonElement.asInstant(): Instant {
|
||||||
val value = try {
|
val value = try {
|
||||||
asString()
|
asString()
|
||||||
@ -125,6 +127,7 @@ fun JsonElement.asInstant(): Instant {
|
|||||||
/**
|
/**
|
||||||
* @return null if the current element is not a valid ISO 8601 [String]
|
* @return null if the current element is not a valid ISO 8601 [String]
|
||||||
*/
|
*/
|
||||||
|
@OptIn(ExperimentalTime::class)
|
||||||
fun JsonElement.asInstantOrNull(): Instant? {
|
fun JsonElement.asInstantOrNull(): Instant? {
|
||||||
return try {
|
return try {
|
||||||
asInstant()
|
asInstant()
|
||||||
|
|||||||
@ -1,20 +1,15 @@
|
|||||||
[versions]
|
[versions]
|
||||||
dokka = "2.0.0"
|
dokka = "2.0.0"
|
||||||
kotlinx-coroutines = "1.10.2"
|
kotlinx-coroutines = "1.10.2"
|
||||||
kotlinx-datetime = "0.6.2"
|
|
||||||
ktor = "3.2.0"
|
ktor = "3.2.0"
|
||||||
mongodb = "5.5.1"
|
mongodb = "5.5.1"
|
||||||
kotlin = "2.0.20"
|
kotlin = "2.2.0"
|
||||||
|
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
|
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
|
||||||
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" }
|
|
||||||
ktor-server-data-conversion = { group = "io.ktor", name = "ktor-server-data-conversion", version.ref = "ktor" }
|
ktor-server-data-conversion = { group = "io.ktor", name = "ktor-server-data-conversion", version.ref = "ktor" }
|
||||||
ktor-serialization-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
|
ktor-serialization-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
|
||||||
mongodb-bson = { group = "org.mongodb", name = "bson", version.ref = "mongodb" }
|
mongodb-bson = { group = "org.mongodb", name = "bson", version.ref = "mongodb" }
|
||||||
mongodb-driver = { group = "org.mongodb", name = "mongodb-driver-kotlin-coroutine", version.ref = "mongodb" }
|
|
||||||
|
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user