mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
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:
@@ -204,6 +204,10 @@ export function getThisYearLastUnixTime() {
|
|||||||
return moment.unix(getThisYearFirstUnixTime()).add(1, 'years').subtract(1, 'seconds').unix();
|
return moment.unix(getThisYearFirstUnixTime()).add(1, 'years').subtract(1, 'seconds').unix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getSpecifiedDayFirstUnixTime(unixTime) {
|
||||||
|
return moment.unix(unixTime).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).unix();
|
||||||
|
}
|
||||||
|
|
||||||
export function getDateTimeFormatType(allFormatMap, allFormatArray, localeDefaultFormatTypeName, systemDefaultFormatType, formatTypeValue) {
|
export function getDateTimeFormatType(allFormatMap, allFormatArray, localeDefaultFormatTypeName, systemDefaultFormatType, formatTypeValue) {
|
||||||
if (formatTypeValue > dateTimeConstants.defaultDateTimeFormatValue && allFormatArray[formatTypeValue - 1] && allFormatArray[formatTypeValue - 1].key) {
|
if (formatTypeValue > dateTimeConstants.defaultDateTimeFormatValue && allFormatArray[formatTypeValue - 1] && allFormatArray[formatTypeValue - 1].key) {
|
||||||
return allFormatArray[formatTypeValue - 1];
|
return allFormatArray[formatTypeValue - 1];
|
||||||
|
|||||||
@@ -424,8 +424,12 @@ import accountConstants from '@/consts/account.js';
|
|||||||
import transactionConstants from '@/consts/transaction.js';
|
import transactionConstants from '@/consts/transaction.js';
|
||||||
import { getNameByKeyValue } from '@/lib/common.js';
|
import { getNameByKeyValue } from '@/lib/common.js';
|
||||||
import {
|
import {
|
||||||
|
getCurrentUnixTime,
|
||||||
|
getSpecifiedDayFirstUnixTime,
|
||||||
getUtcOffsetByUtcOffsetMinutes,
|
getUtcOffsetByUtcOffsetMinutes,
|
||||||
getTimezoneOffsetMinutes,
|
getTimezoneOffsetMinutes,
|
||||||
|
getBrowserTimezoneOffsetMinutes,
|
||||||
|
getActualUnixTimeForStore,
|
||||||
getDateRangeByDateType
|
getDateRangeByDateType
|
||||||
} from '@/lib/datetime.js';
|
} from '@/lib/datetime.js';
|
||||||
import { categoryTypeToTransactionType, transactionTypeToCategoryType } from '@/lib/category.js';
|
import { categoryTypeToTransactionType, transactionTypeToCategoryType } from '@/lib/category.js';
|
||||||
@@ -659,6 +663,11 @@ export default {
|
|||||||
},
|
},
|
||||||
changeDateFilter(dateType) {
|
changeDateFilter(dateType) {
|
||||||
if (dateType === this.allDateRanges.Custom.type) { // Custom
|
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.showCustomDateRangeSheet = true;
|
||||||
this.showDatePopover = false;
|
this.showDatePopover = false;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user