Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
validateDefaultDate() {
let isAcceptable = true;
if (DateUtil.isDateOutOfRange(this.state.dateTime, DateUtil.createSafeDate(this.props.minDateTime), DateUtil.createSafeDate(this.props.maxDateTime))) {
isAcceptable = false;
}
if (DateUtil.isDateExcluded(this.state.dateTime, this.props.excludeDates)) {
isAcceptable = false;
}
return isAcceptable;
}
isDateTimeWithinRange(newDateTime) {
let isAcceptable = true;
if (DateUtil.isDateOutOfRange(newDateTime, DateUtil.createSafeDate(this.props.minDateTime), DateUtil.createSafeDate(this.props.maxDateTime))) {
isAcceptable = false;
}
if (DateUtil.isDateExcluded(newDateTime, this.props.excludeDates)) {
isAcceptable = false;
}
return isAcceptable;
}