defaultDate doesn't work properly
See original GitHub issueHi, When I define the defaultDate prop to the component using a state.date doesn’t look to work correctly.
I got the next:
<DatePicker options={{ defaultDate: new Date(this.state.myDate), setDefaultDate: true, format: 'MM-DD-YYYY' }} />
but when the picker is opened my date is not defined.
Unlike if I define the next:
<DatePicker options={{ defaultDate: new Date('2018-10-20'), setDefaultDate: true, format: 'MM-DD-YYYY' }} />
It works.
Expected behavior: I should be able to see my state.myDate as the default in the picker.
Actual behavior: The actual date ( at the moment of open the picker) is the default
Versions
react-materialize: 3.3.0 materialize-css: 1.0.0 react: 16.8.6
Thanks for helping out!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
JQuery Datepicker Default Date Not Working When Two on ...
I'm using Jquery datepickers to collect two dates on the same page, the calendars display correctly and I' ...
Read more >defaultDate not work · Issue #192 · tempusdominus/bootstrap-4
I followed the demo, set the default date, and there is no way to work properly. What should I do? I set the...
Read more >Date Field “Default Date” doesn't work - WordPress.org
Hey Guys, i want the Datepicker to grey out the next 9 Days from Today. I read that the field Default Date is...
Read more >Powerapps not picking up default Date setting
I am building a Powerapps form based on a SharePoint List. In the SharePoint Settings, I have set the date field to default...
Read more >Default Date Format Not Working - Zoho Cares
I have a registration application I am working on which has a main registration form. The application also has a form to add...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

format should be lowercase
format: “mm-dd-yyyy” Date format options
https://codesandbox.io/s/winter-silence-97yg9
Thanks @victorw999, good catch, closing this then