Update commons-suncalc to 3.5
This commit is contained in:
parent
162cd0b262
commit
134d09c3ae
@ -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")
|
||||
|
||||
@ -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)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user