Add 1st exception rule

This commit is contained in:
Julia Friesel
2018-06-30 15:16:29 +02:00
parent 3a090c5d8a
commit 9e92f072de
4 changed files with 85 additions and 2 deletions
+5
View File
@@ -15,10 +15,15 @@ function getTemperatureStatus(targetDateString, previousDaysInCycle) {
acc.high.push(curr)
}
// regular rule
// we round the difference because of JS decimal weirdness
if (acc.high.length === 3 && rounded(curr - acc.ltl, 0.01) >= 0.2) {
acc.shiftDetected = true
}
// 1st exception rule
if (acc.high.length === 4 && curr > acc.ltl) {
acc.shiftDetected = true
}
return acc
}, {