From 46ee5ec1692e7eb4aaef6e65121c559da09485a4 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 13 May 2025 10:13:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6):=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E7=9A=84=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E9=BB=98=E8=AE=A4=E9=A2=84=E8=A7=88=20MySQL?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E6=BA=90=E6=95=B0=E6=8D=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=BC=BA=E5=B0=91=E4=B8=80=E4=B8=AA=E6=9C=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/custom-component/v-query/time-format.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/custom-component/v-query/time-format.ts b/core/core-frontend/src/custom-component/v-query/time-format.ts index 7453e0bb78..64c9a124c7 100644 --- a/core/core-frontend/src/custom-component/v-query/time-format.ts +++ b/core/core-frontend/src/custom-component/v-query/time-format.ts @@ -48,15 +48,15 @@ function getYearBeginning() { return new Date(dayjs().startOf('year').format('YYYY/MM/DD HH:mm:ss')) } -function getYearMonthRange(result, sort) { +function getYearMonthRange(result, sort, type) { const [direction, scene] = (sort || '').split('-') if (direction === 'start') { - return new Date(result.startOf('day').format('YYYY/MM/DD HH:mm:ss')) + return new Date(result.startOf(type).format('YYYY/MM/DD HH:mm:ss')) } else if (direction === 'end') { if (scene === 'config') { return new Date(result.format('YYYY/MM/DD HH:mm:ss')) } else if (scene === 'panel') { - return new Date(dayjs(result).endOf('day').format('YYYY/MM/DD HH:mm:ss')) + return new Date(dayjs(result).endOf(type).format('YYYY/MM/DD HH:mm:ss')) } } } @@ -75,7 +75,7 @@ function getCustomTime( const result = dayjs()[type](timeNum, timeType === 'date' ? 'day' : timeType) if (['monthrange', 'yearrange', 'daterange'].includes(timeGranularityMultiple)) { - return getYearMonthRange(result, sort) + return getYearMonthRange(result, sort, timeGranularityMultiple.split('range')[0]) } if (!!arbitraryTime) {