You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had issues setting up react-datepicker as the component deals with moment objects but this does not play so well when used with the rest of my app that is using Redux and is also sending request to an external API.
I think this is a common setup requirement to have the date available to the rest of the react app in a string format once the date has been picked.
With some help from a friend we got this working but it definitley took a bit of mucking around having moment objects available in certain places and date strings available in other places.
Here is the code I got working for anyone having these issues, would be great to include a few of these clues in the README or tips also just not quite sure what to emphasise or where this should best be put.
Open to suggestions and happy to create a pull request to update documentation if that would be welcome.
I had the same issues you had. My redux application state should store a string while the onChange for the date picker has a Moment object as argument and the value prop for the picker takes a moment object, not a string. Thank you for for code sample.
I had issues setting up react-datepicker as the component deals with moment objects but this does not play so well when used with the rest of my app that is using Redux and is also sending request to an external API.
I think this is a common setup requirement to have the date available to the rest of the react app in a string format once the date has been picked.
With some help from a friend we got this working but it definitley took a bit of mucking around having moment objects available in certain places and date strings available in other places.
Here is the code I got working for anyone having these issues, would be great to include a few of these clues in the README or tips also just not quite sure what to emphasise or where this should best be put.
Open to suggestions and happy to create a pull request to update documentation if that would be welcome.
The text was updated successfully, but these errors were encountered: