diff options
Diffstat (limited to 'src/main/kotlin')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/types/Date.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/src/main/kotlin/pl/treksoft/kvision/types/Date.kt index 7b5acc59..99511dee 100644 --- a/src/main/kotlin/pl/treksoft/kvision/types/Date.kt +++ b/src/main/kotlin/pl/treksoft/kvision/types/Date.kt @@ -29,7 +29,9 @@ import kotlinx.serialization.internal.SerialClassDescImpl import pl.treksoft.kvision.KVManager import kotlin.js.Date -actual val KV_DATE_FORMAT = "YYYY-MM-DD HH:mm:ss" +actual val KV_DEFAULT_DATE_FORMAT = "YYYY-MM-DD HH:mm:ss" + +actual val KV_JSON_DATE_FORMAT = "YYYY-MM-DD HH:mm:ssZZ" actual typealias Date = kotlin.js.Date @@ -58,10 +60,10 @@ object DateSerializer : KSerializer<Date> { override val descriptor: SerialDescriptor = SerialClassDescImpl("kotlin.js.Date") override fun deserialize(input: Decoder): Date { - return input.decodeString().toDateF() + return input.decodeString().toDateF(KV_JSON_DATE_FORMAT) } override fun serialize(output: Encoder, obj: Date) { - output.encodeString(obj.toStringF()) + output.encodeString(obj.toStringF(KV_JSON_DATE_FORMAT)) } } |