diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-10-13 03:37:40 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-10-13 03:37:40 +0200 |
commit | ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c (patch) | |
tree | 7cac3c5449eb8aa398b279d62d9a67ed34fa4115 /kvision-modules/kvision-common/src/main/kotlin/pl | |
parent | 470953c78c2509224bb452c16f8bbea54e53b3d7 (diff) | |
download | kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.tar.gz kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.tar.bz2 kvision-ebce2c4b839c0b2f8be78bc31c1ce12c45a0164c.zip |
Major refactoring of the multi-platform components.
Dependencies upgrade.
A lot of code style fixes.
Diffstat (limited to 'kvision-modules/kvision-common/src/main/kotlin/pl')
-rw-r--r-- | kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/types/Date.kt (renamed from kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt) | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/types/Date.kt index 0cb1a1f1..86a72b33 100644 --- a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/types/KDate.kt +++ b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/types/Date.kt @@ -21,29 +21,8 @@ */ package pl.treksoft.kvision.types -import kotlinx.serialization.Serializable +expect class Date -expect val KDATE_FORMAT: String +expect fun String.toDateF(format: String = "YYYY-MM-DD HH:mm:ss"): Date -/** - * A serializable wrapper for a multiplatform Date type. - */ -@Serializable -data class KDate(val time: Long) { - constructor() : this(now().time) - constructor(str: String) : this(str.toKDateF(KDATE_FORMAT).time) - - override fun toString(): String { - return this.toStringF(KDATE_FORMAT) - } - - companion object { - fun now() = nowDate() - } -} - -expect fun nowDate(): KDate - -expect fun String.toKDateF(format: String): KDate - -expect fun KDate.toStringF(format: String): String +expect fun Date.toStringF(format: String = "YYYY-MM-DD HH:mm:ss"): String |