react-multi-date-picker
react-multi-date-picker copied to clipboard
onChange not working when using handleChange Formik
I really like your package but when I put the handleChange from Formik into the onChange property of datepicker , it won't do anything right.
+1 returning wrong dates
@wafaa-ismail sorry I didn't get it. please explain to me
onchange returns DateObject, not javascript Date. log the returning event somewhere, you will get the point.
As a workaround you can pass a callback which will support handleChange
(handleChange expects a Change Event)
For eg.
onChange={ (newDate) => ({ target: { name: "inputName", value: newDate.toDate(), // Converting DateObject to JS Date } }) }
this way fix my problem