aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/Form.kt3
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/types/Date.kt6
2 files changed, 3 insertions, 6 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
index ccd6363b..983b83e5 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
@@ -30,7 +30,6 @@ import kotlinx.serialization.serializer
import pl.treksoft.kvision.i18n.I18n.trans
import pl.treksoft.kvision.types.DateSerializer
import pl.treksoft.kvision.types.KFile
-import pl.treksoft.kvision.types.KV_JSON_DATE_FORMAT
import pl.treksoft.kvision.types.toStringF
import pl.treksoft.kvision.utils.JSON
import pl.treksoft.kvision.utils.getContent
@@ -91,7 +90,7 @@ class Form<K : Any>(private val panel: FormPanel<K>? = null, private val seriali
val map = it.flatMap { entry ->
when (entry.value) {
is Date -> {
- listOf(entry.key to (entry.value as? Date)?.toStringF(KV_JSON_DATE_FORMAT))
+ listOf(entry.key to (entry.value as? Date)?.toStringF())
}
is List<*> -> {
@Suppress("UNCHECKED_CAST")
diff --git a/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
index 153003ab..ffa5008a 100644
--- a/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
@@ -31,8 +31,6 @@ import kotlin.js.Date
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
/**
@@ -60,10 +58,10 @@ object DateSerializer : KSerializer<Date> {
override val descriptor: SerialDescriptor = SerialClassDescImpl("kotlin.js.Date")
override fun deserialize(decoder: Decoder): Date {
- return decoder.decodeString().toDateF(KV_JSON_DATE_FORMAT)
+ return decoder.decodeString().toDateF()
}
override fun serialize(encoder: Encoder, obj: Date) {
- encoder.encodeString(obj.toStringF(KV_JSON_DATE_FORMAT))
+ encoder.encodeString(obj.toStringF())
}
}