fix the problem the end time not equals to the current time in transaction list page when timezone not set to browser timezone

This commit is contained in:
MaysWind
2023-06-15 01:27:15 +08:00
parent 83b72e7403
commit 28dc2e425a
2 changed files with 13 additions and 0 deletions
@@ -424,8 +424,12 @@ import accountConstants from '@/consts/account.js';
import transactionConstants from '@/consts/transaction.js';
import { getNameByKeyValue } from '@/lib/common.js';
import {
getCurrentUnixTime,
getSpecifiedDayFirstUnixTime,
getUtcOffsetByUtcOffsetMinutes,
getTimezoneOffsetMinutes,
getBrowserTimezoneOffsetMinutes,
getActualUnixTimeForStore,
getDateRangeByDateType
} from '@/lib/datetime.js';
import { categoryTypeToTransactionType, transactionTypeToCategoryType } from '@/lib/category.js';
@@ -659,6 +663,11 @@ export default {
},
changeDateFilter(dateType) {
if (dateType === this.allDateRanges.Custom.type) { // Custom
if (!this.query.minTime || !this.query.maxTime) {
this.query.maxTime = getActualUnixTimeForStore(getCurrentUnixTime(), getTimezoneOffsetMinutes(), getBrowserTimezoneOffsetMinutes());
this.query.minTime = getSpecifiedDayFirstUnixTime(this.query.maxTime);
}
this.showCustomDateRangeSheet = true;
this.showDatePopover = false;
return;