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:
tina
2018-12-13 18:28:39 +00:00
+2 -1
View File
@@ -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
}