From 848fb384243f873bbfa3508085693eb192e9c30e Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 16 Apr 2026 09:57:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=8C=83=E5=9B=B4=E5=BF=AB=E6=8D=B7=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E5=91=A8=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/custom-component/v-query/shortcuts.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/custom-component/v-query/shortcuts.ts b/core/core-frontend/src/custom-component/v-query/shortcuts.ts index 159e834df3..c460533979 100644 --- a/core/core-frontend/src/custom-component/v-query/shortcuts.ts +++ b/core/core-frontend/src/custom-component/v-query/shortcuts.ts @@ -1,10 +1,12 @@ import { useI18n } from '@/hooks/web/useI18n' import dayjs from 'dayjs' +import 'dayjs/locale/zh-cn' import type { ManipulateType, QUnitType } from 'dayjs' import quarterOfYear from 'dayjs/plugin/quarterOfYear' type ManipulateTypeWithQuarter = ManipulateType | 'quarter' const { t } = useI18n() dayjs.extend(quarterOfYear) +dayjs.locale('zh-cn') function getThisStart(val = 'month' as ManipulateTypeWithQuarter) { return new Date(dayjs().startOf(val).format('YYYY/MM/DD HH:mm:ss')) @@ -56,8 +58,8 @@ const shortcuts = [ { text: 'dynamic_time.cweek', onClick: ({ emit }) => { - const startTime = new Date(+new Date(getThisStart('week')) + 24 * 1000 * 3600) - const endTime = new Date(+new Date(getThisEnd('week')) + 24 * 1000 * 3600) + const startTime = getThisStart('week') + const endTime = getThisEnd('week') if (callback([startTime, endTime])) return emit('pick', [dayjs(startTime), dayjs(endTime)]) } @@ -93,8 +95,8 @@ const shortcuts = [ { text: 'dynamic_time.lweek', onClick: ({ emit }) => { - const startTime = new Date(+new Date(getLastStart('week')) + 24 * 1000 * 3600) - const endTime = new Date(+new Date(getLastEnd('week')) + 24 * 1000 * 3600) + const startTime = getLastStart('week') + const endTime = getLastEnd('week') if (callback([startTime, endTime])) return emit('pick', [dayjs(startTime), dayjs(endTime)]) }