Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleKeyPress = e => {
if (e.key === 'Enter') {
if (DateUtils.isDate(new Date(e.target.value))) {
this.handleDayClick(e.target.value);
}
}
};
const parseDate = (str, format, locale) => {
const parsed = dateFnsParse(str, format, new Date(), { locale });
return DateUtils.isDate(parsed) ? parsed : null;
};
function parseDate(str, format, locale) {
const parsed = dateFnsParse(str, format, { locale });
if (DateUtils.isDate(parsed)) {
return parsed;
}
return undefined;
}