diff options
Diffstat (limited to 'packages/bank/src/components/picker/DatePicker.tsx')
-rw-r--r-- | packages/bank/src/components/picker/DatePicker.tsx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/bank/src/components/picker/DatePicker.tsx b/packages/bank/src/components/picker/DatePicker.tsx index 91467a1..94dbc94 100644 --- a/packages/bank/src/components/picker/DatePicker.tsx +++ b/packages/bank/src/components/picker/DatePicker.tsx @@ -131,41 +131,41 @@ export class DatePicker extends Component<Props, State> { * Display previous month by updating state */ displayPrevMonth() { - if (this.state.displayedMonth <= 0) { + if (this.state.displayedMonth <= 0) this.setState({ displayedMonth: 11, displayedYear: this.state.displayedYear - 1, }); - } else { + else this.setState({ displayedMonth: this.state.displayedMonth - 1, }); - } + } /** * Display next month by updating state */ displayNextMonth() { - if (this.state.displayedMonth >= 11) { + if (this.state.displayedMonth >= 11) this.setState({ displayedMonth: 0, displayedYear: this.state.displayedYear + 1, }); - } else { + else this.setState({ displayedMonth: this.state.displayedMonth + 1, }); - } + } /** * Display the selected month (gets fired when clicking on the date string) */ displaySelectedMonth() { - if (this.state.selectYearMode) { + if (this.state.selectYearMode) this.toggleYearSelector(); - } else { + else { if (!this.state.currentDate) return false; this.setState({ displayedMonth: this.state.currentDate.getMonth(), @@ -351,6 +351,6 @@ export class DatePicker extends Component<Props, State> { } } -for (let i = 2010; i <= now.getFullYear() + 10; i++) { +for (let i = 2010; i <= now.getFullYear() + 10; i++) yearArr.push(i); -} + |