Hi,
I want to check if the DayPickerInput field is empty. Currently I just receive an undefined for both cases empty and invalid date for the onDayChange method. With this I'm not sure if the date field is really empty or invalid.
Any ideas?
A solution proposal could be:
Add a modifier "invalid-date" if the date is invalid or empty if the date input field is empty. In both cases the value/day would stay undefined.
Thanks a lot for support.
Yes this is true. I could add a third argument to onDayChange. I think I could send the DayPickerInput instance so you would have full access to it:
onDayChange(day, modifiers, instance) {
if (instance.getInput().value === '') {
this.setState({ inputIsEmpty: true });
}
}
Your solution with a third parameter sounds better 馃憤
@olimination please upgrade to v7.2.1! Check out this example: http://react-day-picker.js.org/examples/input-state
Thanks a lot @gpbl
I have integrated the new version and it seems to work smoothly!
Most helpful comment
Yes this is true. I could add a third argument to
onDayChange. I think I could send theDayPickerInputinstance so you would have full access to it: