Skip to content

Commit

Permalink
refactor variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
robertparkinson committed Oct 22, 2024
1 parent c6769e6 commit 96ebe1f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/lib/return-cycle-dates.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ function cycleDueDate (summer) {
cycleDueYear = month > returnCycleDates.allYear.endDate.month ? year + 1 : year
}

const cycleDueDate = new Date(`${cycleDueYear}-${cycleDueMonth}-${cycleDueDay}`)
const dueDate = new Date(`${cycleDueYear}-${cycleDueMonth}-${cycleDueDay}`)

return cycleDueDate
return dueDate
}

/**
Expand Down Expand Up @@ -77,9 +77,9 @@ function cycleDueDateByDate (date, summer) {
cycleDueYear = month > returnCycleDates.allYear.endDate.month ? year + 1 : year
}

const cycleDueDate = new Date(`${cycleDueYear}-${cycleDueMonth}-${cycleDueDay}`)
const dueDate = new Date(`${cycleDueYear}-${cycleDueMonth}-${cycleDueDay}`)

return formatDateObjectToISO(cycleDueDate)
return formatDateObjectToISO(dueDate)
}

/**
Expand Down Expand Up @@ -119,9 +119,9 @@ function cycleEndDate (summer) {
cycleEndYear = month > returnCycleDates.allYear.endDate.month ? year + 1 : year
}

const cycleEndDate = new Date(`${cycleEndYear}-${cycleEndMonth}-${cycleEndDay}`)
const endDate = new Date(`${cycleEndYear}-${cycleEndMonth}-${cycleEndDay}`)

return cycleEndDate
return endDate
}

/**
Expand Down Expand Up @@ -151,9 +151,9 @@ function cycleEndDateByDate (date, summer) {
cycleEndYear = month > returnCycleDates.allYear.endDate.month ? year + 1 : year
}

const cycleEndDate = new Date(`${cycleEndYear}-${cycleEndMonth}-${cycleEndDay}`)
const endDate = new Date(`${cycleEndYear}-${cycleEndMonth}-${cycleEndDay}`)

return formatDateObjectToISO(cycleEndDate)
return formatDateObjectToISO(endDate)
}

/**
Expand Down Expand Up @@ -193,9 +193,9 @@ function cycleStartDate (summer) {
cycleStartYear = month < returnCycleDates.allYear.startDate.month ? year - 1 : year
}

const cycleEndDate = new Date(`${cycleStartYear}-${cycleStartMonth}-${cycleStartDay}`)
const startDate = new Date(`${cycleStartYear}-${cycleStartMonth}-${cycleStartDay}`)

return cycleEndDate
return startDate
}

/**
Expand Down Expand Up @@ -225,9 +225,9 @@ function cycleStartDateByDate (date, summer) {
cycleStartYear = month < returnCycleDates.allYear.startDate.month ? year - 1 : year
}

const cycleEndDate = new Date(`${cycleStartYear}-${cycleStartMonth}-${cycleStartDay}`)
const startDate = new Date(`${cycleStartYear}-${cycleStartMonth}-${cycleStartDay}`)

return formatDateObjectToISO(cycleEndDate)
return formatDateObjectToISO(startDate)
}

module.exports = {
Expand Down

0 comments on commit 96ebe1f

Please sign in to comment.