Better fix for adjustToReferenceTime()
This commit is contained in:
parent
d863f5d660
commit
0e357d968c
1 changed files with 5 additions and 3 deletions
|
@ -152,9 +152,11 @@ class AutosensDataStoreObject : AutosensDataStore {
|
||||||
}
|
}
|
||||||
var diff = abs(someTime - referenceTime)
|
var diff = abs(someTime - referenceTime)
|
||||||
diff %= T.mins(5).msecs()
|
diff %= T.mins(5).msecs()
|
||||||
if (diff > T.mins(2).plus(T.secs(30)).msecs()) diff -= T.mins(5).msecs()
|
if (diff > T.mins(2).plus(T.secs(30)).msecs()){
|
||||||
diff = abs(diff)
|
return someTime + abs(diff - T.mins(5).msecs()) // Adjust to the future
|
||||||
return someTime + diff
|
} else {
|
||||||
|
return someTime - diff // adjust to the past
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isAbout5minData(aapsLogger: AAPSLogger): Boolean {
|
fun isAbout5minData(aapsLogger: AAPSLogger): Boolean {
|
||||||
|
|
Loading…
Reference in a new issue