possible to get all cycle lengths, which get evaluated in stats
This commit is contained in:
+19
-2
@@ -130,11 +130,28 @@ export default function config(opts) {
|
||||
}
|
||||
}
|
||||
|
||||
function getAllMensesStarts(day, collectedDates) {
|
||||
day = day || LocalDate.now().toString()
|
||||
collectedDates = collectedDates || []
|
||||
if (!day) {
|
||||
return null
|
||||
} else {
|
||||
const lastStart = getLastMensesStart(day)
|
||||
if (!lastStart) {
|
||||
return collectedDates
|
||||
} else {
|
||||
const newDay = LocalDate.parse(lastStart.date).minusDays(1).toString()
|
||||
collectedDates.push(lastStart.date)
|
||||
return getAllMensesStarts(newDay, collectedDates)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
getCycleDayNumber,
|
||||
getCycleForDay,
|
||||
getPreviousCycle,
|
||||
getCyclesBefore,
|
||||
getLastMensesStart
|
||||
getLastMensesStart,
|
||||
getAllMensesStarts
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user