aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/utils
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2017-11-12 03:26:57 +0100
committerRobert Jaros <rjaros@finn.pl>2017-11-12 03:26:57 +0100
commitc5c29491437f1b9de2ab6bff05a1455b42edfcfc (patch)
treeb9d20472a9427d1bf8d8880c52e206333ca94513 /src/main/kotlin/pl/treksoft/kvision/utils
parenta4343ed3c4021db99de0fbc3f7c76929ad758265 (diff)
downloadkvision-c5c29491437f1b9de2ab6bff05a1455b42edfcfc.tar.gz
kvision-c5c29491437f1b9de2ab6bff05a1455b42edfcfc.tar.bz2
kvision-c5c29491437f1b9de2ab6bff05a1455b42edfcfc.zip
DateTimePicker components
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/utils')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
index e2396868..b426e432 100644
--- a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
@@ -3,7 +3,9 @@
package pl.treksoft.kvision.utils
import pl.treksoft.kvision.core.CssSize
+import pl.treksoft.kvision.core.KVManager
import pl.treksoft.kvision.core.UNIT
+import kotlin.js.Date
fun Int.px(): CssSize = Pair(this, UNIT.px)
fun Int.em(): CssSize = Pair(this, UNIT.em)
@@ -34,3 +36,13 @@ fun Int.toHexString(): String {
}
return result
}
+
+@Suppress("UnsafeCastFromDynamic")
+fun String.toDateF(format: String = "YYYY-MM-DD HH:mm:ss"): Date {
+ return KVManager.fecha.parse(this, format)
+}
+
+@Suppress("UnsafeCastFromDynamic")
+fun Date.toStringF(format: String = "YYYY-MM-DD HH:mm:ss"): String {
+ return KVManager.fecha.format(this, format)
+}