aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-02-18 19:12:10 +0100
committerRobert Jaros <rjaros@finn.pl>2019-02-18 19:12:10 +0100
commit5178fc613b673367ceef2e907cda7c6386f7ac40 (patch)
tree5f600c8b7aa129853dd61b3732885550a4aea7d1 /kvision-modules
parent07ef074ccc18f58aabb0714407d97db59a8897b5 (diff)
downloadkvision-5178fc613b673367ceef2e907cda7c6386f7ac40.tar.gz
kvision-5178fc613b673367ceef2e907cda7c6386f7ac40.tar.bz2
kvision-5178fc613b673367ceef2e907cda7c6386f7ac40.zip
Simplifications for multiplatform Date type.
Diffstat (limited to 'kvision-modules')
-rw-r--r--kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt6
-rw-r--r--kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/types/Date.kt22
-rw-r--r--kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/types/Date.kt6
-rw-r--r--kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/types/Date.kt6
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/types/Date.kt6
5 files changed, 9 insertions, 37 deletions
diff --git a/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
index 909b0b95..55e1b15f 100644
--- a/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
+++ b/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
@@ -21,10 +21,4 @@
*/
package pl.treksoft.kvision.types
-expect val KV_DEFAULT_DATE_FORMAT: String
-
expect class Date
-
-expect fun String.toDateF(format: String = KV_DEFAULT_DATE_FORMAT): Date
-
-expect fun Date.toStringF(format: String = KV_DEFAULT_DATE_FORMAT): String
diff --git a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
index 8cab5348..6dc85060 100644
--- a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
+++ b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
@@ -44,25 +44,3 @@ object JsonDateSerializer : KSerializer<Date> {
encoder.encodeLong(obj.getTime().toLong())
}
}
-
-/**
- * @suppress
- * Not used in this module.
- */
-actual val KV_DEFAULT_DATE_FORMAT = ""
-
-/**
- * @suppress
- * Not used in this module.
- */
-actual fun String.toDateF(format: String): Date {
- TODO("Unimplemented")
-}
-
-/**
- * @suppress
- * Not used in this module.
- */
-actual fun Date.toStringF(format: String): String {
- TODO("Unimplemented")
-}
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 b1f72d6f..678d6828 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
@@ -23,10 +23,10 @@ package pl.treksoft.kvision.types
import java.text.SimpleDateFormat
-actual val KV_DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"
+val KV_DEFAULT_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)
+fun String.toDateF(format: String = KV_DEFAULT_DATE_FORMAT): Date = SimpleDateFormat(format).parse(this)
-actual fun Date.toStringF(format: String): String = SimpleDateFormat(format).format(this)
+fun Date.toStringF(format: String = KV_DEFAULT_DATE_FORMAT): String = SimpleDateFormat(format).format(this)
diff --git a/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
index b1f72d6f..678d6828 100644
--- a/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
+++ b/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
@@ -23,10 +23,10 @@ package pl.treksoft.kvision.types
import java.text.SimpleDateFormat
-actual val KV_DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"
+val KV_DEFAULT_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)
+fun String.toDateF(format: String = KV_DEFAULT_DATE_FORMAT): Date = SimpleDateFormat(format).parse(this)
-actual fun Date.toStringF(format: String): String = SimpleDateFormat(format).format(this)
+fun Date.toStringF(format: String = KV_DEFAULT_DATE_FORMAT): String = SimpleDateFormat(format).format(this)
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 b1f72d6f..678d6828 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
@@ -23,10 +23,10 @@ package pl.treksoft.kvision.types
import java.text.SimpleDateFormat
-actual val KV_DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"
+val KV_DEFAULT_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)
+fun String.toDateF(format: String = KV_DEFAULT_DATE_FORMAT): Date = SimpleDateFormat(format).parse(this)
-actual fun Date.toStringF(format: String): String = SimpleDateFormat(format).format(this)
+fun Date.toStringF(format: String = KV_DEFAULT_DATE_FORMAT): String = SimpleDateFormat(format).format(this)