Skip to content

Commit

Permalink
chore: update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Sep 24, 2024
1 parent 7930087 commit 2f31f29
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/generate/dayjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ const parseNoMatchNotice = () => {
const generateConfig: GenerateConfig<Dayjs> = {
// 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'),
Expand Down

0 comments on commit 2f31f29

Please sign in to comment.