Add test for getCycleDayNumber
This commit is contained in:
+1
-2
@@ -40,7 +40,7 @@ export default function config(opts) {
|
||||
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
|
||||
if (diffInDays >= maxCycleLength) return null
|
||||
// cycle starts at day 1
|
||||
return diffInDays + 1
|
||||
}
|
||||
@@ -65,7 +65,6 @@ export default function config(opts) {
|
||||
}
|
||||
|
||||
function getCycleForCycleStartDay(startDay) {
|
||||
// TODO this needs to be made cycle length aware. all other places can go?
|
||||
const cycleStartIndex = cycleDaysSortedByDate.indexOf(startDay)
|
||||
const i = cycleStartsSortedByDate.indexOf(startDay)
|
||||
const nextMensesStart = cycleStartsSortedByDate[i - 1]
|
||||
|
||||
Reference in New Issue
Block a user