Shorten line lengths in cycle
This commit is contained in:
+4
-3
@@ -28,19 +28,20 @@ export default function config(opts) {
|
||||
return day
|
||||
})
|
||||
|
||||
const firstBleedingBeforeTargetDayIndex = withWrappedDates.findIndex(day => {
|
||||
// the index of the first bleeding day before the target day
|
||||
const index = withWrappedDates.findIndex(day => {
|
||||
return (
|
||||
day.wrappedDate.isEqual(targetDate) ||
|
||||
day.wrappedDate.isBefore(targetDate)
|
||||
)
|
||||
})
|
||||
|
||||
if (firstBleedingBeforeTargetDayIndex < 0) {
|
||||
if (index < 0) {
|
||||
withWrappedDates.forEach(day => delete day.wrappedDate)
|
||||
return null
|
||||
}
|
||||
|
||||
const prevBleedingDays = withWrappedDates.slice(firstBleedingBeforeTargetDayIndex)
|
||||
const prevBleedingDays = withWrappedDates.slice(index)
|
||||
|
||||
const lastMensesStart = prevBleedingDays.find((day, i) => {
|
||||
return noBleedingDayWithinThreshold(day, prevBleedingDays.slice(i + 1))
|
||||
|
||||
Reference in New Issue
Block a user