Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
onChange(undefined)
}
return this.setState({ text_value: '' })
}
value = trimInvalidPart(value, format)
const selected_day = parseDate(value, format, noon, utc)
// If the date input is unparseable,
// or if it's one of the disabled days,
// then don't change the selected date.
if (!selected_day ||
disabledDays && ModifiersUtils.dayMatchesModifier(selected_day, disabledDays))
{
return this.setState({ text_value: value })
}
// Call `onChange` only if `value` did actually change
if (!previous_value || previous_value.getTime() !== selected_day.getTime())
{
onChange(selected_day)
}
this.setState
({
text_value: value
},
() => this.calendar && this.calendar.showMonth(selected_day))
}