Topic: DatePicker passing a default value

dd free asked 6 years ago


Hey everyoneHow to pass a default value to datepicker in mdb react, I tried the defaultValue property but I don\'t know how to format the value which I am passingAny help?!Thank you in advance:)))

Mikołaj Smoleński staff answered 6 years ago


To pass a default value You need to add a property 'defaultDate' to the DatePicker component. For example:
var value = new Date();
<DatePicker defaultDate={value} style={{borderBottom: '1px solid #bdbdbd', height: '3rem'}} id="datepicker" textFieldStyle={{width: '100%'}} hintText="Selected date" ></DatePicker>
Regards

dd free commented 6 years ago

Thank you very much :))

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Closed

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags