mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
use the preset name if custom date range matches a preset item
This commit is contained in:
@@ -274,6 +274,7 @@ import {
|
||||
getYearMonthFirstUnixTime,
|
||||
getYearMonthLastUnixTime,
|
||||
getShiftedDateRangeAndDateType,
|
||||
getDateTypeByDateRange,
|
||||
getDateRangeByDateType
|
||||
} from '@/lib/datetime.js';
|
||||
import { isChartDataTypeAvailableForAnalysisType } from '@/lib/statistics.js';
|
||||
@@ -648,16 +649,20 @@ export default {
|
||||
}
|
||||
|
||||
if (this.analysisType === statisticsConstants.allAnalysisTypes.CategoricalAnalysis) {
|
||||
const chartDateType = getDateTypeByDateRange(startTime, endTime, this.firstDayOfWeek, datetimeConstants.allDateRangeScenes.Normal);
|
||||
|
||||
this.statisticsStore.updateTransactionStatisticsFilter({
|
||||
categoricalChartDateType: this.allDateRanges.Custom.type,
|
||||
categoricalChartDateType: chartDateType,
|
||||
categoricalChartStartTime: startTime,
|
||||
categoricalChartEndTime: endTime
|
||||
});
|
||||
|
||||
this.showCustomDateRangeDialog = false;
|
||||
} else if (this.analysisType === statisticsConstants.allAnalysisTypes.TrendAnalysis) {
|
||||
const chartDateType = getDateTypeByDateRange(getYearMonthFirstUnixTime(startTime), getYearMonthLastUnixTime(endTime), this.firstDayOfWeek, datetimeConstants.allDateRangeScenes.TrendAnalysis);
|
||||
|
||||
this.statisticsStore.updateTransactionStatisticsFilter({
|
||||
trendChartDateType: this.allDateRanges.Custom.type,
|
||||
trendChartDateType: chartDateType,
|
||||
trendChartStartYearMonth: startTime,
|
||||
trendChartEndYearMonth: endTime
|
||||
});
|
||||
|
||||
@@ -371,6 +371,7 @@ import {
|
||||
getBrowserTimezoneOffsetMinutes,
|
||||
getActualUnixTimeForStore,
|
||||
getShiftedDateRangeAndDateType,
|
||||
getDateTypeByDateRange,
|
||||
getDateRangeByDateType,
|
||||
getRecentDateRangeType,
|
||||
isDateRangeMatchOneMonth
|
||||
@@ -797,8 +798,10 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const dateType = getDateTypeByDateRange(minTime, maxTime, this.firstDayOfWeek, datetimeConstants.allDateRangeScenes.Normal);
|
||||
|
||||
this.transactionsStore.updateTransactionListFilter({
|
||||
dateType: datetimeConstants.allDateRanges.Custom.type,
|
||||
dateType: dateType,
|
||||
maxTime: maxTime,
|
||||
minTime: minTime
|
||||
});
|
||||
|
||||
@@ -261,6 +261,7 @@ import statisticsConstants from '@/consts/statistics.js';
|
||||
import { getNameByKeyValue, limitText, formatPercent } from '@/lib/common.js'
|
||||
import {
|
||||
getShiftedDateRangeAndDateType,
|
||||
getDateTypeByDateRange,
|
||||
getDateRangeByDateType
|
||||
} from '@/lib/datetime.js';
|
||||
import { scrollToSelectedItem } from '@/lib/ui.mobile.js';
|
||||
@@ -492,8 +493,10 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const chartDateType = getDateTypeByDateRange(startTime, endTime, this.firstDayOfWeek, datetimeConstants.allDateRangeScenes.Normal);
|
||||
|
||||
this.statisticsStore.updateTransactionStatisticsFilter({
|
||||
categoricalChartDateType: this.allDateRanges.Custom.type,
|
||||
categoricalChartDateType: chartDateType,
|
||||
categoricalChartStartTime: startTime,
|
||||
categoricalChartEndTime: endTime
|
||||
});
|
||||
|
||||
@@ -439,6 +439,7 @@ import {
|
||||
getBrowserTimezoneOffsetMinutes,
|
||||
getActualUnixTimeForStore,
|
||||
getShiftedDateRangeAndDateType,
|
||||
getDateTypeByDateRange,
|
||||
getDateRangeByDateType
|
||||
} from '@/lib/datetime.js';
|
||||
import { categoryTypeToTransactionType, transactionTypeToCategoryType } from '@/lib/category.js';
|
||||
@@ -720,8 +721,10 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const dateType = getDateTypeByDateRange(minTime, maxTime, this.firstDayOfWeek, datetimeConstants.allDateRangeScenes.Normal);
|
||||
|
||||
this.transactionsStore.updateTransactionListFilter({
|
||||
dateType: this.allDateRanges.Custom.type,
|
||||
dateType: dateType,
|
||||
maxTime: maxTime,
|
||||
minTime: minTime
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user