From 96ebe1f78901103184ae31175f3c3facba984ffd Mon Sep 17 00:00:00 2001 From: robertparkinson Date: Tue, 22 Oct 2024 13:44:11 +0100 Subject: [PATCH] refactor variable names --- app/lib/return-cycle-dates.lib.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/lib/return-cycle-dates.lib.js b/app/lib/return-cycle-dates.lib.js index 14093e6d15..cc2a504190 100644 --- a/app/lib/return-cycle-dates.lib.js +++ b/app/lib/return-cycle-dates.lib.js @@ -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 } /** @@ -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) } /** @@ -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 } /** @@ -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) } /** @@ -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 } /** @@ -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 = {