From 2f31f29a24448adea136af3a1cba86d007fa8700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=BE=F0=9D=92=96=F0=9D=92=99=F0=9D=92=89?= Date: Tue, 24 Sep 2024 11:15:40 +0800 Subject: [PATCH] chore: update logic --- src/generate/dayjs.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/generate/dayjs.ts b/src/generate/dayjs.ts index 02cd18ea4..91291ce30 100644 --- a/src/generate/dayjs.ts +++ b/src/generate/dayjs.ts @@ -108,11 +108,12 @@ const parseNoMatchNotice = () => { const generateConfig: GenerateConfig = { // get getNow: () => { - // if (typeof dayjs.tz === 'function') { - // // https://github.com/ant-design/ant-design/discussions/50934 - // return dayjs.tz(); - // } - return dayjs(); + const now = dayjs(); + // https://github.com/ant-design/ant-design/discussions/50934 + if (typeof now.tz === 'function') { + return now.tz(); // use default timezone + } + return now; }, getFixedDate: (string) => dayjs(string, ['YYYY-M-DD', 'YYYY-MM-DD']), getEndDate: (date) => date.endOf('month'),