Ignore secondary symptom peak after end of temperature evaluation
This commit is contained in:
+7
-2
@@ -16,8 +16,6 @@ export default function (cycleDays, tempEvalEndIndex) {
|
||||
if (day.mucus.value !== currentBestQuality) continue
|
||||
|
||||
// the three following days must be of lower quality
|
||||
// AND no best quality day may occur until temperature evaluation has
|
||||
// been completed
|
||||
const threeFollowingDays = mucusDays.slice(i + 1, i + 4)
|
||||
if (threeFollowingDays.length < 3) continue
|
||||
|
||||
@@ -27,6 +25,13 @@ export default function (cycleDays, tempEvalEndIndex) {
|
||||
if (bestQualityOccursIn3FollowingDays) continue
|
||||
|
||||
const cycleDayIndex = cycleDays.indexOf(day)
|
||||
|
||||
// if temperature evaluation has been completed an we still haven't found
|
||||
// a candidate, there is no cervix shift
|
||||
if (cycleDayIndex > tempEvalEndIndex) return notDetected
|
||||
|
||||
// no best quality day may occur until temperature evaluation has
|
||||
// been completed
|
||||
const relevantDays = cycleDays
|
||||
.slice(cycleDayIndex + 1, tempEvalEndIndex + 1)
|
||||
.filter(day => day.mucus && !day.mucus.exclude)
|
||||
|
||||
Reference in New Issue
Block a user