aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-remote/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-modules/kvision-remote/src/main/kotlin')
-rw-r--r--kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/types/Date.kt2
1 files changed, 2 insertions, 0 deletions
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 90fdd2df..ca323264 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
@@ -57,6 +57,7 @@ internal object JsonDateSerializer : KSerializer<Date> {
}
}
+@Suppress("ComplexMethod", "MagicNumber")
internal fun String.toDateInternal(): Date {
val dt = this.split(':', 'T', '-', '+')
val utcCheck = this[length - 1] == 'Z'
@@ -89,6 +90,7 @@ internal fun String.toDateInternal(): Date {
}
internal fun Date.toStringInternal(): String {
+ @Suppress("MagicNumber")
val tz = this.getTimezoneOffset() / 60
val sign = if (tz > 0) "-" else "+"
return "" + this.getFullYear() + "-" + ("0" + (this.getMonth() + 1)).takeLast(2) + "-" +