only returns cycledaynumber when it is not greater than 99
This commit is contained in:
+2
-1
@@ -39,7 +39,8 @@ export default function config(opts) {
|
|||||||
const targetDate = LocalDate.parse(targetDateString)
|
const targetDate = LocalDate.parse(targetDateString)
|
||||||
const lastMensesLocalDate = LocalDate.parse(lastMensesStart.date)
|
const lastMensesLocalDate = LocalDate.parse(lastMensesStart.date)
|
||||||
const diffInDays = lastMensesLocalDate.until(targetDate, DAYS)
|
const diffInDays = lastMensesLocalDate.until(targetDate, DAYS)
|
||||||
|
// take maxCycleLength into account (we don't display cycle day numbers higher than 99 at the moment)
|
||||||
|
if (diffInDays >= 99) return null
|
||||||
// cycle starts at day 1
|
// cycle starts at day 1
|
||||||
return diffInDays + 1
|
return diffInDays + 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user