From c78775aa2aaf76f9fa1404ff32a10fb8227f380e Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Fri, 25 Oct 2019 20:46:42 +0200 Subject: Style fixes --- .../kvision-remote/src/main/kotlin/pl/treksoft/kvision/types/Date.kt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kvision-modules/kvision-remote/src/main/kotlin/pl') 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 { } } +@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) + "-" + -- cgit