Rename getCycleForCycleStartDay
This commit is contained in:
+5
-7
@@ -50,7 +50,7 @@ export default function config(opts) {
|
||||
const i = cycleStartsSortedByDate.indexOf(cycleStart)
|
||||
const earlierCycleStart = cycleStartsSortedByDate[i + 1]
|
||||
if (!earlierCycleStart) return null
|
||||
return getCycleForStartDay(earlierCycleStart)
|
||||
return getCycleForCycleStartDay(earlierCycleStart)
|
||||
}
|
||||
|
||||
function getCyclesBefore(targetCycleStartDay) {
|
||||
@@ -60,10 +60,10 @@ export default function config(opts) {
|
||||
if (startFromHere < 0) return null
|
||||
return cycleStartsSortedByDate
|
||||
.slice(startFromHere)
|
||||
.map(getCycleForStartDay)
|
||||
.map(getCycleForCycleStartDay)
|
||||
}
|
||||
|
||||
function getCycleForStartDay(startDay) {
|
||||
function getCycleForCycleStartDay(startDay) {
|
||||
const cycleStartIndex = cycleDaysSortedByDate.indexOf(startDay)
|
||||
const i = cycleStartsSortedByDate.indexOf(startDay)
|
||||
const nextMensesStart = cycleStartsSortedByDate[i - 1]
|
||||
@@ -81,7 +81,7 @@ export default function config(opts) {
|
||||
const dateString = typeof dayOrDate === 'string' ? dayOrDate : dayOrDate.date
|
||||
const cycleStart = getLastMensesStartForDay(dateString)
|
||||
if (!cycleStart) return null
|
||||
return getCycleForStartDay(cycleStart)
|
||||
return getCycleForCycleStartDay(cycleStart)
|
||||
}
|
||||
|
||||
function isMensesStart(cycleDay) {
|
||||
@@ -103,9 +103,7 @@ export default function config(opts) {
|
||||
|
||||
function getMensesDaysRightAfter(cycleDay) {
|
||||
const bleedingDays = bleedingDaysSortedByDate
|
||||
.filter(d => {
|
||||
return !d.bleeding.exclude
|
||||
})
|
||||
.filter(d => !d.bleeding.exclude)
|
||||
.reverse()
|
||||
const firstFollowingBleedingDayIndex = bleedingDays.findIndex(day => {
|
||||
return day.date > cycleDay.date
|
||||
|
||||
Reference in New Issue
Block a user