pushtell / react-bootstrap-date-picker

React-Bootstrap based date picker.
MIT License
347 stars 195 forks source link

Default value doesn't work #81

Open kimdotnet opened 7 years ago

kimdotnet commented 7 years ago

<DatePicker ref={(testDate) => { testDateInput = testDate }} defaultValue={testDate} dateFormat='YYYY-MM-DD' />

But the input field, doen't display the default value

DoWhileGeek commented 7 years ago

Can confirm, default value does nothing.

wehriam commented 7 years ago

It sets the hidden input element. See:

https://github.com/pushtell/react-bootstrap-date-picker/blob/master/test/core.test.jsx#L723-L749

It looks like we need to also set the text input value. PR's are appreciated!

ebrenes commented 7 years ago

This seems to be working on master, I can't replicate the defaultValue issue.

gReis89 commented 7 years ago

am trying to set a default value for Today's date(the date popup shows when first opened without values) is that could be accomplished with defaultValue property? if yes, it's not working on release: "react-bootstrap-date-picker": "^5.0.1",

bvn13 commented 7 years ago

does not work, confirmed.

avremel commented 7 years ago

confirmed, not working 5.1.0