add all date type range in transaction list page

This commit is contained in:
MaysWind
2023-08-01 22:25:55 +08:00
parent 6e798f739f
commit 43522e9c81
3 changed files with 28 additions and 8 deletions
+12 -2
View File
@@ -597,7 +597,7 @@ function getAllDateRanges(includeCustom, translateFn) {
return allDateRanges;
}
function getAllRecentMonthDateRanges(userStore, includeCustom, translateFn) {
function getAllRecentMonthDateRanges(userStore, includeAll, includeCustom, translateFn) {
const allRecentMonthDateRanges = [];
const recentDateRanges = getRecentMonthDateRanges(12);
@@ -610,10 +610,20 @@ function getAllRecentMonthDateRanges(userStore, includeCustom, translateFn) {
maxTime: recentDateRange.maxTime,
year: recentDateRange.year,
month: recentDateRange.month,
isPreset: true,
displayName: formatUnixTime(recentDateRange.minTime, getI18nLongYearMonthFormat(translateFn, userStore.currentUserLongDateFormat))
});
}
if (includeAll) {
allRecentMonthDateRanges.push({
dateType: datetime.allDateRanges.All.type,
minTime: 0,
maxTime: 0,
displayName: translateFn('All')
});
}
if (includeCustom) {
allRecentMonthDateRanges.push({
dateType: datetime.allDateRanges.Custom.type,
@@ -1054,7 +1064,7 @@ export function i18nFunctions(i18nGlobal) {
getAllCurrencies: () => getAllCurrencies(i18nGlobal.t),
getAllWeekDays: () => getAllWeekDays(i18nGlobal.t),
getAllDateRanges: (includeCustom) => getAllDateRanges(includeCustom, i18nGlobal.t),
getAllRecentMonthDateRanges: (userStore, includeCustom) => getAllRecentMonthDateRanges(userStore, 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),
getAllStatisticsChartDataTypes: () => getAllStatisticsChartDataTypes(i18nGlobal.t),
getAllStatisticsSortingTypes: () => getAllStatisticsSortingTypes(i18nGlobal.t),