support setting timezone type for the time range of statistical data

This commit is contained in:
MaysWind
2024-04-12 09:51:01 +08:00
parent 14f6de8af1
commit ea32bfa5fc
18 changed files with 398 additions and 31 deletions
+16
View File
@@ -762,6 +762,21 @@ function getDateRangeDisplayName(userStore, dateType, startTime, endTime, transl
return `${displayStartTime} ~ ${displayEndTime}`;
}
function getAllTimezoneTypesUsedForStatistics(currentTimezone, translateFn) {
const currentTimezoneOffset = getTimezoneOffset(currentTimezone);
return [
{
displayName: translateFn('Application Timezone') + ` (UTC${currentTimezoneOffset})`,
type: timezone.allTimezoneTypesUsedForStatistics.ApplicationTimezone
},
{
displayName: translateFn('Transaction Timezone'),
type: timezone.allTimezoneTypesUsedForStatistics.TransactionTimezone
}
];
}
function getAllAccountCategories(translateFn) {
const allAccountCategories = [];
@@ -1333,6 +1348,7 @@ export function i18nFunctions(i18nGlobal) {
getAllDateRanges: (includeCustom) => getAllDateRanges(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),
getAllAccountCategories: () => getAllAccountCategories(i18nGlobal.t),
getAllAccountTypes: () => getAllAccountTypes(i18nGlobal.t),
getAllStatisticsChartDataTypes: () => getAllStatisticsChartDataTypes(i18nGlobal.t),