Susu
Susu

Reputation: 1

MUI-X TimePicker component's referenceDate prop

I have @mui/x-date-pickers-pro: ^6.10.0 installed. How should I set the referenceDate? I'm using moment as date-time library and have tried giving the referenceDate prop value moment(). This doesn't do anything.

If value is not set, I would like to have the time picker dialog open up at the current time, not 00:00. But referenceDate={moment()} doesn't affect this. With the prop, the picker still opens up at 00:00

Upvotes: 0

Views: 74

Answers (1)

vsync
vsync

Reputation: 130560

referenceDate prop accepts a javascript Date object, you could use

referenceDate={new Date()}

Upvotes: 0

Related Questions