add billing cycle date range filter

This commit is contained in:
MaysWind
2024-12-16 23:44:20 +08:00
parent 8fdbb39ee4
commit 647cd3c33f
12 changed files with 226 additions and 23 deletions
+14 -2
View File
@@ -644,7 +644,7 @@ function getAllWeekDays(firstDayOfWeek, translateFn) {
return allWeekDays;
}
function getAllDateRanges(scene, includeCustom, translateFn) {
function getAllDateRanges(scene, includeCustom, includeBillingCycle, translateFn) {
const allDateRanges = [];
for (let dateRangeField in datetimeConstants.allDateRanges) {
@@ -658,6 +658,18 @@ function getAllDateRanges(scene, includeCustom, translateFn) {
continue;
}
if (dateRangeType.isBillingCycle) {
if (includeBillingCycle) {
allDateRanges.push({
type: dateRangeType.type,
displayName: translateFn(dateRangeType.name),
isBillingCycle: dateRangeType.isBillingCycle
});
}
continue;
}
if (includeCustom || dateRangeType.type !== datetimeConstants.allDateRanges.Custom.type) {
allDateRanges.push({
type: dateRangeType.type,
@@ -1746,7 +1758,7 @@ export function i18nFunctions(i18nGlobal) {
getTimezoneDifferenceDisplayText: (utcOffset) => getTimezoneDifferenceDisplayText(utcOffset, i18nGlobal.t),
getAllCurrencies: () => getAllCurrencies(i18nGlobal.t),
getAllWeekDays: (firstDayOfWeek) => getAllWeekDays(firstDayOfWeek, i18nGlobal.t),
getAllDateRanges: (scene, includeCustom) => getAllDateRanges(scene, includeCustom, i18nGlobal.t),
getAllDateRanges: (scene, includeCustom, includeBillingCycle) => getAllDateRanges(scene, includeCustom, includeBillingCycle, i18nGlobal.t),
getAllRecentMonthDateRanges: (userStore, includeAll, includeCustom) => getAllRecentMonthDateRanges(userStore, includeAll, includeCustom, i18nGlobal.t),
getDateRangeDisplayName: (userStore, dateType, startTime, endTime) => getDateRangeDisplayName(userStore, dateType, startTime, endTime, i18nGlobal.t),
getAllTimezoneTypesUsedForStatistics: (currentTimezone) => getAllTimezoneTypesUsedForStatistics(currentTimezone, i18nGlobal.t),