onClose, react-date-presets returns undefined startDate, endDate, when pick a range. OK if select custom-range

234 views Asked by At

If i select a custom range, the onClose correctly return startDate and endDate but if i pick one value from the ranges it will break since returns undefined.

I have to find a way to grab the updated startDate and endDate inside the onClose function also if i select one range.

Here the example: https://codesandbox.io/s/clever-shamir-gyi0m?file=/src/App.js

1

There are 1 answers

0
Matteobikk90 On

Had to modify the library, you can find a fix for this here: https://github.com/Matteobikk90/react-dates-presets

Essentially onClose were not sending the values(startDate, endDate) if the user was selecting a range.