Handle cycle with mucus on first cycle day
This commit is contained in:
+9
-3
@@ -16,9 +16,15 @@ export default function getSymptoThermalStatus({ cycle, previousCycle, earlierCy
|
||||
if (previousCycle) {
|
||||
const statusForLast = getSymptoThermalStatus({ cycle: previousCycle })
|
||||
if (statusForLast.temperatureShift) {
|
||||
status.phases.preOvulatory = getPreOvulatoryPhase(cycle, [previousCycle, ...earlierCycles])
|
||||
if (status.phases.preOvulatory.cycleDays.length === cycle.length) {
|
||||
return status
|
||||
const preOvuPhase = getPreOvulatoryPhase(
|
||||
cycle,
|
||||
[previousCycle, ...earlierCycles]
|
||||
)
|
||||
if (preOvuPhase) {
|
||||
status.phases.preOvulatory = preOvuPhase
|
||||
if (status.phases.preOvulatory.cycleDays.length === cycle.length) {
|
||||
return status
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ export default function(cycle, previousCycles) {
|
||||
return d.date <= preOvuEndDate
|
||||
})
|
||||
const preOvulatoryDays = getDaysUntilFertileMucus(maybePreOvuDays)
|
||||
// if mucus occurs on the 1st cycle day, there is no pre-ovu phase
|
||||
if (!preOvulatoryDays.length) return null
|
||||
|
||||
let endDate
|
||||
if (preOvulatoryDays.length === maybePreOvuDays.length) {
|
||||
endDate = preOvuEndDate
|
||||
|
||||
Reference in New Issue
Block a user