From ee7fbae29cc7038b787821d57f4e1482355e7ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20F=C3=BCrderer?= Date: Sun, 9 Jun 2019 16:29:37 +0200 Subject: [PATCH] Fix display of the month at creation date This time on serialization as well as on deserialization --- .../hso/texturesyncclient/controller/net/InternalJsonModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/controller/net/InternalJsonModel.kt b/client/src/main/kotlin/org/hso/texturesyncclient/controller/net/InternalJsonModel.kt index 324b430..326dd55 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/controller/net/InternalJsonModel.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/controller/net/InternalJsonModel.kt @@ -30,7 +30,7 @@ internal data class InternalTexture( resolution = arrayOf(tex.resolution.first, tex.resolution.second), added_on = arrayOf( tex.addedOn.get(Calendar.YEAR), // - tex.addedOn.get(Calendar.MONTH), // + tex.addedOn.get(Calendar.MONTH) + 1, // tex.addedOn.get(Calendar.DAY_OF_MONTH) ), texture_hash = tex.textureHash.toString() @@ -50,7 +50,7 @@ internal data class InternalTexture( else -> throw ConnectionInvalidJsonException() }, resolution = Pair(resolution[0], resolution[1]), - addedOn = GregorianCalendar(added_on[0], added_on[1], added_on[2]), + addedOn = GregorianCalendar(added_on[0], added_on[1] - 1, added_on[2]), textureHash = Sha256(texture_hash) ) } catch (e: Exception) { // i Know, but no time :[]