From a9e3b79eb15758ca27ed472b5074574f7b3344c4 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 26 May 2024 22:57:57 +0800 Subject: [PATCH] fix the bug that the selected date range in date selection dialog would not change to current set range after opening the date selection dialog in desktop version --- src/components/desktop/DateRangeSelectionDialog.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/desktop/DateRangeSelectionDialog.vue b/src/components/desktop/DateRangeSelectionDialog.vue index 41b005c2..8abc0e93 100644 --- a/src/components/desktop/DateRangeSelectionDialog.vue +++ b/src/components/desktop/DateRangeSelectionDialog.vue @@ -170,6 +170,18 @@ export default { return presetRanges; } }, + watch: { + 'minTime': function (newValue) { + if (newValue) { + this.dateRange[0] = getLocalDatetimeFromUnixTime(getDummyUnixTimeForLocalUsage(newValue, getTimezoneOffsetMinutes(), getBrowserTimezoneOffsetMinutes())); + } + }, + 'maxTime': function (newValue) { + if (newValue) { + this.dateRange[1] = getLocalDatetimeFromUnixTime(getDummyUnixTimeForLocalUsage(newValue, getTimezoneOffsetMinutes(), getBrowserTimezoneOffsetMinutes())); + } + } + }, setup() { const theme = useTheme();