From 134d09c3aeaa232b4243bd8b1483a34fe7135b47 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Mon, 31 Jan 2022 13:29:54 +0100 Subject: [PATCH] Update commons-suncalc to 3.5 --- settings.gradle.kts | 2 +- .../de/mm20/launcher2/weather/metno/MetNoProvider.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index c99d48f8..e7b8ffd6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -300,7 +300,7 @@ dependencyResolutionManagement { alias("suncalc") .to("org.shredzone.commons", "commons-suncalc") - .version("2.12") + .version("3.5") alias("jsoup") .to("org.jsoup", "jsoup") diff --git a/weather/src/main/java/de/mm20/launcher2/weather/metno/MetNoProvider.kt b/weather/src/main/java/de/mm20/launcher2/weather/metno/MetNoProvider.kt index 72cbd027..05a4d4fb 100644 --- a/weather/src/main/java/de/mm20/launcher2/weather/metno/MetNoProvider.kt +++ b/weather/src/main/java/de/mm20/launcher2/weather/metno/MetNoProvider.kt @@ -32,20 +32,20 @@ class MetNoProvider(override val context: Context) : LatLonWeatherProvider() { val rise = sunTimes.rise if (set == null && rise != null) { - return timestamp < rise.time + return timestamp < rise.toEpochSecond() * 1000 } if (set != null && rise == null) { - return set.time < timestamp + return set.toEpochSecond() * 1000 < timestamp } if (set == null || rise == null) return false - if (set.time < rise.time) { - return (set.time < timestamp && timestamp < rise.time) + if (set.toEpochSecond() < rise.toEpochSecond()) { + return (set.toEpochSecond() * 1000 < timestamp && timestamp < rise.toEpochSecond() * 1000) } - return !(rise.time < timestamp && timestamp < set.time) + return !(rise.toEpochSecond() * 1000 < timestamp && timestamp < set.toEpochSecond() * 1000) }