mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-25 01:57:15 +00:00
commit
bd2558e852
@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## 0.20.46
|
||||
|
||||
* `Common`:
|
||||
* Now this repo depends on `klock`
|
||||
* Add new object-serializer `DateTimeSerializer` for `klock` serializer
|
||||
|
||||
## 0.20.45
|
||||
|
||||
* `Versions`:
|
||||
|
@ -8,6 +8,11 @@ apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
|
||||
|
||||
kotlin {
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
api libs.klock
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
api project(":micro_utils.coroutines")
|
||||
|
@ -0,0 +1,23 @@
|
||||
package dev.inmo.micro_utils.common
|
||||
|
||||
import korlibs.time.DateTime
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.Serializer
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
|
||||
@Serializer(DateTime::class)
|
||||
object DateTimeSerializer : KSerializer<DateTime> {
|
||||
override val descriptor: SerialDescriptor
|
||||
get() = Double.serializer().descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): DateTime {
|
||||
return DateTime(decoder.decodeDouble())
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: DateTime) {
|
||||
encoder.encodeDouble(value.unixMillis)
|
||||
}
|
||||
}
|
@ -15,5 +15,5 @@ crypto_js_version=4.1.1
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.20.45
|
||||
android_code_version=251
|
||||
version=0.20.46
|
||||
android_code_version=252
|
||||
|
@ -12,7 +12,6 @@ kotlin {
|
||||
dependencies {
|
||||
api internalProject("micro_utils.common")
|
||||
api libs.kt.serialization.cbor
|
||||
api libs.klock
|
||||
api libs.uuid
|
||||
api libs.ktor.io
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user