aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-server-spring-boot/src
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-12-22 22:39:42 +0100
committerRobert Jaros <rjaros@finn.pl>2018-12-22 22:39:42 +0100
commit932a7b7bdae6c90fbcadb563775a9721cf4741cd (patch)
treeb1336dbf930a830e40489cd00e2d1c84b8c04697 /kvision-modules/kvision-server-spring-boot/src
parentb6d1dc12e04cf0857358820ee236f2e16c2dbf78 (diff)
downloadkvision-932a7b7bdae6c90fbcadb563775a9721cf4741cd.tar.gz
kvision-932a7b7bdae6c90fbcadb563775a9721cf4741cd.tar.bz2
kvision-932a7b7bdae6c90fbcadb563775a9721cf4741cd.zip
Fix incompatible date formats between platforms.
Diffstat (limited to 'kvision-modules/kvision-server-spring-boot/src')
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt3
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/types/Date.kt2
2 files changed, 4 insertions, 1 deletions
diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index 45c5c565..24c6c9db 100644
--- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -28,6 +28,7 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.slf4j.Logger
import org.slf4j.LoggerFactory
+import pl.treksoft.kvision.types.KV_DATE_FORMAT
import java.text.SimpleDateFormat
import javax.servlet.http.HttpServletResponse
import kotlin.reflect.KClass
@@ -48,7 +49,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
val optionsRequests: MutableMap<String, (Request, HttpServletResponse) -> Unit> = mutableMapOf()
val mapper = jacksonObjectMapper().apply {
- dateFormat = SimpleDateFormat("YYYY-MM-DD HH:mm:ss")
+ dateFormat = SimpleDateFormat(KV_DATE_FORMAT)
}
var counter: Int = 0
diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
index 32c8923e..8ce8cbd4 100644
--- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
+++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
@@ -29,6 +29,8 @@ 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 typealias Date = java.util.Date
actual fun String.toDateF(format: String): Date = SimpleDateFormat(format).parse(this)