secondarySymptom as default;

be more explicit for periOvuEnd calculation
This commit is contained in:
emelko
2018-09-07 19:45:55 +02:00
parent d16feb6d58
commit e2c8292d7f
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ export default function getSymptoThermalStatus(cycleInfo) {
if (tempOver > secondarySymptomOver) {
periOvulatoryEnd = temperatureShift.evaluationCompleteDay
} else {
} else if (secondarySymptom > tempOver) {
periOvulatoryEnd = secondaryShift.evaluationCompleteDay
}
+2 -2
View File
@@ -13,7 +13,7 @@ export default function(cycle, previousCycles) {
return d.date <= preOvuEndDate
})
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
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 => {
if (secondarySymptom === 'mucus') {
return day.mucus && day.mucus.value > 1