Fix string/int type issue

This commit is contained in:
Quantum 2022-02-13 14:49:14 -05:00
parent 2a1a18da13
commit 6f4751af2a

View file

@ -164,11 +164,10 @@ export class Calendar extends React.Component<CalendarProps, CalendarState> {
} }
monthChange(event: any) { monthChange(event: any) {
this.goToNormalized(this.props.year, event.target.value as Month); this.goToNormalized(this.props.year, +event.target.value as Month);
} }
yearChange(event: any) { yearChange(event: any) {
console.log(/^-?\d+/.test(event.target.value));
if (/^-?\d+/.test(event.target.value)) { if (/^-?\d+/.test(event.target.value)) {
this.goToNormalized(+event.target.value, this.props.month); this.goToNormalized(+event.target.value, this.props.month);
} }