From 0a9cea4df3b8b3e3e70233c678ea979268ee046e Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 23 Dec 2024 08:50:24 +0800 Subject: [PATCH] do not check whether the date range is billing cycle when no statement date --- src/lib/datetime.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/datetime.js b/src/lib/datetime.js index a417531d..2e5f8ac7 100644 --- a/src/lib/datetime.js +++ b/src/lib/datetime.js @@ -489,8 +489,8 @@ export function getShiftedDateRangeAndDateType(minTime, maxTime, scale, firstDay } export function getShiftedDateRangeAndDateTypeForBillingCycle(minTime, maxTime, scale, firstDayOfWeek, scene, statementDate) { - if (!dateTimeConstants.allDateRanges.PreviousBillingCycle.availableScenes[scene] || !dateTimeConstants.allDateRanges.CurrentBillingCycle.availableScenes[scene]) { - return; + if (!statementDate || !dateTimeConstants.allDateRanges.PreviousBillingCycle.availableScenes[scene] || !dateTimeConstants.allDateRanges.CurrentBillingCycle.availableScenes[scene]) { + return null; } const previousBillingCycleRange = getDateRangeByBillingCycleDateType(dateTimeConstants.allDateRanges.PreviousBillingCycle.type, firstDayOfWeek, statementDate); @@ -535,8 +535,8 @@ export function getDateTypeByDateRange(minTime, maxTime, firstDayOfWeek, scene) } export function getDateTypeByBillingCycleDateRange(minTime, maxTime, firstDayOfWeek, scene, statementDate) { - if (!dateTimeConstants.allDateRanges.PreviousBillingCycle.availableScenes[scene] || !dateTimeConstants.allDateRanges.CurrentBillingCycle.availableScenes[scene]) { - return; + if (!statementDate || !dateTimeConstants.allDateRanges.PreviousBillingCycle.availableScenes[scene] || !dateTimeConstants.allDateRanges.CurrentBillingCycle.availableScenes[scene]) { + return null; } const previousBillingCycleRange = getDateRangeByBillingCycleDateType(dateTimeConstants.allDateRanges.PreviousBillingCycle.type, firstDayOfWeek, statementDate);