Skip to content

Commit 826726b

Browse files
authored
feat(luxon-getNow): Improve the response tz setting for obtaining the current time method (#883)
1 parent a6db0d6 commit 826726b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/generate/luxon.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ const normalizeLocale = (locale: string): string => locale.replace(/_/g, '-');
5757

5858
const generateConfig: GenerateConfig<DateTime> = {
5959
// get
60-
getNow: () => DateTime.local(),
60+
getNow: () => {
61+
/**
62+
* The current time that can respond to tz settings is required. like `dayjs().tz()`.
63+
* @see: https://github.com/ant-design/ant-design/issues/51282
64+
* https://github.com/react-component/picker/pull/878
65+
*/
66+
return DateTime.now();
67+
},
6168
getFixedDate: (string) => DateTime.fromFormat(string, 'yyyy-MM-dd'),
6269
getEndDate: (date) => date.endOf('month'),
6370
getWeekDay: (date) => date.weekday,

0 commit comments

Comments
 (0)