secondarySymptom as default;
be more explicit for periOvuEnd calculation
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ export default function getSymptoThermalStatus(cycleInfo) {
|
|||||||
|
|
||||||
if (tempOver > secondarySymptomOver) {
|
if (tempOver > secondarySymptomOver) {
|
||||||
periOvulatoryEnd = temperatureShift.evaluationCompleteDay
|
periOvulatoryEnd = temperatureShift.evaluationCompleteDay
|
||||||
} else {
|
} else if (secondarySymptom > tempOver) {
|
||||||
periOvulatoryEnd = secondaryShift.evaluationCompleteDay
|
periOvulatoryEnd = secondaryShift.evaluationCompleteDay
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default function(cycle, previousCycles) {
|
|||||||
return d.date <= preOvuEndDate
|
return d.date <= preOvuEndDate
|
||||||
})
|
})
|
||||||
const preOvulatoryDays = getDaysUntilFertileSecondarySymptom(maybePreOvuDays)
|
const preOvulatoryDays = getDaysUntilFertileSecondarySymptom(maybePreOvuDays)
|
||||||
// if mucus occurs on the 1st cycle day, there is no pre-ovu phase
|
// if fertile mucus or cervix occurs on the 1st cycle day, there is no pre-ovu phase
|
||||||
if (!preOvulatoryDays.length) return null
|
if (!preOvulatoryDays.length) return null
|
||||||
|
|
||||||
let endDate
|
let endDate
|
||||||
@@ -34,7 +34,7 @@ export default function(cycle, previousCycles) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDaysUntilFertileSecondarySymptom(days, secondarySymptom) {
|
function getDaysUntilFertileSecondarySymptom(days, secondarySymptom = 'mucus') {
|
||||||
const firstFertileSecondarySymptomDayIndex = days.findIndex(day => {
|
const firstFertileSecondarySymptomDayIndex = days.findIndex(day => {
|
||||||
if (secondarySymptom === 'mucus') {
|
if (secondarySymptom === 'mucus') {
|
||||||
return day.mucus && day.mucus.value > 1
|
return day.mucus && day.mucus.value > 1
|
||||||
@@ -47,4 +47,4 @@ function getDaysUntilFertileSecondarySymptom(days, secondarySymptom) {
|
|||||||
return days.slice(0, firstFertileSecondarySymptomDayIndex)
|
return days.slice(0, firstFertileSecondarySymptomDayIndex)
|
||||||
}
|
}
|
||||||
return days
|
return days
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user