Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prevState => ({
calendarDate: today,
highlightedIndex:
prevState.suggestedItems.length +
getDateInMonth(today, this.props.timeZone) -
1,
}),
() => this.inputRef.current.focus()
name: PropTypes.string,
placeholder: PropTypes.string,
isDisabled: PropTypes.bool,
isReadOnly: PropTypes.bool,
hasError: PropTypes.bool,
hasWarning: PropTypes.bool,
};
inputRef = React.createRef();
timeInputRef = React.createRef();
state = {
calendarDate: getToday(this.props.timeZone),
suggestedItems: [],
highlightedIndex:
this.props.value === ''
? null
: getDateInMonth(this.props.value, this.props.timeZone) - 1,
timeString: '',
};
jumpMonths = amount => {
this.setState(prevState => {
const nextDate = changeMonth(
prevState.calendarDate,
this.props.timeZone,
amount
);
return { calendarDate: nextDate, highlightedIndex: 0 };
});
};
showToday = () => {
const today = getToday(this.props.timeZone);
this.setState(
prevState => ({