aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-remote/src/main/kotlin
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-10-25 20:46:42 +0200
committerRobert Jaros <rjaros@finn.pl>2019-10-25 20:46:42 +0200
commitc78775aa2aaf76f9fa1404ff32a10fb8227f380e (patch)
treea6991e1f520e1ce54679b2194a756203a645f99e /kvision-modules/kvision-remote/src/main/kotlin
parenta990385dd3f2dbac4807b7a9498271efb3519c0d (diff)
downloadkvision-c78775aa2aaf76f9fa1404ff32a10fb8227f380e.tar.gz
kvision-c78775aa2aaf76f9fa1404ff32a10fb8227f380e.tar.bz2
kvision-c78775aa2aaf76f9fa1404ff32a10fb8227f380e.zip
Style fixes
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) + "-" +