Handle cycle with mucus on first cycle day

This commit is contained in:
Julia Friesel
2018-07-24 14:21:10 +02:00
parent 5468c8051d
commit 5ce6bc8cfc
4 changed files with 53 additions and 3 deletions
+3
View File
@@ -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