aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/utils')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
index 5ae9a601..a1901c35 100644
--- a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
@@ -188,8 +188,9 @@ fun Int.toHexString(): String {
* @return Date object
*/
@Suppress("UnsafeCastFromDynamic")
-fun String.toDateF(format: String = "YYYY-MM-DD HH:mm:ss"): Date {
- return KVManager.fecha.parse(this, format)
+fun String.toDateF(format: String = "YYYY-MM-DD HH:mm:ss"): Date? {
+ val result = KVManager.fecha.parse(this, format)
+ return if (result) result else null
}
/**