Topic: Datepicker set a blank value
johndoe pro asked 5 years ago
Is there a way to set the datepicker to be a blank value instead of defaulting to todays date?
As this datepicker will be an optional end date.
Edit: Also is there a way to pass dates to be disabled.
I see the jquery datepicker version allows passing dates to disable but don't see it in the react version.
Jakub Mandra staff answered 5 years ago
Hi,
DatePicker uses valueDefault
property. It is by default set to new Date()
.
You just need to set property valueDefault={null}
and the DatePicker will be blank.
There is no particular dates disabling functionality implemented, you can use disablePast
and disableFuture
.
Best,
Jakub
Evolet free commented 2 years ago
What part of the datepicker do I put this value?
Wojciech Staniszewski staff commented 2 years ago
It should look like here:
<MDBDatePicker valueDefault={new Date("12.12.2012")} />
Evolet free commented 2 years ago
That worked thanks!
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: 4.13.0
- Device: Desktop
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No