Merge branch '131-use-max-cycle-length' into 'master'
use max cycle length Closes #131 See merge request bloodyhealth/drip!136
This commit is contained in:
+2
-1
@@ -39,7 +39,8 @@ export default function config(opts) {
|
||||
const targetDate = LocalDate.parse(targetDateString)
|
||||
const lastMensesLocalDate = LocalDate.parse(lastMensesStart.date)
|
||||
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
|
||||
return diffInDays + 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user