add chart date type settings for trend analysis

This commit is contained in:
MaysWind
2024-05-27 00:50:50 +08:00
parent 5eca777891
commit f041e7cb7d
16 changed files with 446 additions and 190 deletions
+6 -2
View File
@@ -655,7 +655,7 @@ function getAllWeekDays(translateFn) {
return allWeekDays;
}
function getAllDateRanges(includeCustom, translateFn) {
function getAllDateRanges(scene, includeCustom, translateFn) {
const allDateRanges = [];
for (let dateRangeField in datetime.allDateRanges) {
@@ -665,6 +665,10 @@ function getAllDateRanges(includeCustom, translateFn) {
const dateRangeType = datetime.allDateRanges[dateRangeField];
if (!dateRangeType.availableScenes[scene]) {
continue;
}
if (includeCustom || dateRangeType.type !== datetime.allDateRanges.Custom.type) {
allDateRanges.push({
type: dateRangeType.type,
@@ -1376,7 +1380,7 @@ export function i18nFunctions(i18nGlobal) {
getTimezoneDifferenceDisplayText: (utcOffset) => getTimezoneDifferenceDisplayText(utcOffset, i18nGlobal.t),
getAllCurrencies: () => getAllCurrencies(i18nGlobal.t),
getAllWeekDays: () => getAllWeekDays(i18nGlobal.t),
getAllDateRanges: (includeCustom) => getAllDateRanges(includeCustom, i18nGlobal.t),
getAllDateRanges: (scene, includeCustom) => getAllDateRanges(scene, includeCustom, 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),