aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-server-jooby/src/main/kotlin/pl
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-01-19 01:04:34 +0100
committerRobert Jaros <rjaros@finn.pl>2019-01-19 01:04:34 +0100
commit07f9472afaffb3d6187d15eb13368f3b8f3b1b7b (patch)
tree750e5d43149a1e86d1842a976ffccb2efe71adb4 /kvision-modules/kvision-server-jooby/src/main/kotlin/pl
parent9d2cbb456840e649edb263f7ee90eca5fab2cfb4 (diff)
downloadkvision-07f9472afaffb3d6187d15eb13368f3b8f3b1b7b.tar.gz
kvision-07f9472afaffb3d6187d15eb13368f3b8f3b1b7b.tar.bz2
kvision-07f9472afaffb3d6187d15eb13368f3b8f3b1b7b.zip
Add timezone info to the JSON date format.
Diffstat (limited to 'kvision-modules/kvision-server-jooby/src/main/kotlin/pl')
-rw-r--r--kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt4
-rw-r--r--kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt3
-rw-r--r--kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/types/Date.kt4
3 files changed, 7 insertions, 4 deletions
diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt
index d447cf28..dd5e2dfd 100644
--- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt
+++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt
@@ -26,7 +26,7 @@ import org.jooby.Kooby
import org.jooby.Request
import org.jooby.json.Jackson
import org.pac4j.core.profile.CommonProfile
-import pl.treksoft.kvision.types.KV_DATE_FORMAT
+import pl.treksoft.kvision.types.KV_JSON_DATE_FORMAT
import java.text.SimpleDateFormat
import kotlinx.coroutines.async as coroutinesAsync
@@ -40,7 +40,7 @@ actual open class KVServer(init: KVServer.() -> Unit) : Kooby() {
@Suppress("LeakingThis")
assets("/**").onMissing(0)
val mapper = jacksonObjectMapper().apply {
- dateFormat = SimpleDateFormat(KV_DATE_FORMAT)
+ dateFormat = SimpleDateFormat(KV_JSON_DATE_FORMAT)
}
@Suppress("LeakingThis")
use(Jackson(mapper))
diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index 63d3b1f3..8035cd49 100644
--- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -30,6 +30,7 @@ import org.jooby.Request
import org.jooby.Response
import org.slf4j.Logger
import org.slf4j.LoggerFactory
+import pl.treksoft.kvision.types.KV_JSON_DATE_FORMAT
import java.text.SimpleDateFormat
import kotlin.reflect.KClass
@@ -44,7 +45,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
protected val routes: MutableList<KVServer.() -> Unit> = mutableListOf()
val mapper = jacksonObjectMapper().apply {
- dateFormat = SimpleDateFormat("YYYY-MM-DD HH:mm:ss")
+ dateFormat = SimpleDateFormat(KV_JSON_DATE_FORMAT)
}
var counter: Int = 0
diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
index 8ce8cbd4..57853c8b 100644
--- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
+++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
@@ -29,7 +29,9 @@ import com.github.andrewoma.kwery.mapper.util.camelToLowerUnderscore
import java.sql.Timestamp
import java.text.SimpleDateFormat
-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:ssZ"
actual typealias Date = java.util.Date