Shorten pre-ovu phase when early mucus
This commit is contained in:
@@ -5,13 +5,20 @@ export default function(cycle) {
|
||||
const fiveDayEndDate = startDate.plusDays(4).toString()
|
||||
const fiveDayRuleDays = cycle.slice(0, 5).filter(d => d.date <= fiveDayEndDate)
|
||||
const preOvulatoryDays = getDaysUntilFertileMucus(fiveDayRuleDays)
|
||||
let endDate
|
||||
if (preOvulatoryDays.length === fiveDayRuleDays.length) {
|
||||
endDate = fiveDayEndDate
|
||||
} else {
|
||||
endDate = preOvulatoryDays[preOvulatoryDays.length - 1].date
|
||||
}
|
||||
|
||||
return {
|
||||
cycleDays: preOvulatoryDays,
|
||||
start: {
|
||||
date: preOvulatoryDays[0].date
|
||||
},
|
||||
end: {
|
||||
date: fiveDayEndDate
|
||||
date: endDate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user