This commit is contained in:
Sam 2018-07-29 12:06:36 +02:00
parent d37db4a714
commit 928981c627
2 changed files with 16 additions and 16 deletions

View File

@ -150,7 +150,7 @@ class Calendar extends React.Component {
return <div className="body">{rows}</div> return <div className="body">{rows}</div>
} }
updateStateDate (calendarDate) { updateStateDate(calendarDate) {
const { start, end } = getStartAndEndMonth(calendarDate) const { start, end } = getStartAndEndMonth(calendarDate)
this.setState({ this.setState({
currentMonth: calendarDate, currentMonth: calendarDate,
@ -160,12 +160,12 @@ class Calendar extends React.Component {
this.props.loadMonthActivities(start, end) this.props.loadMonthActivities(start, end)
} }
handleNextMonth () { handleNextMonth() {
const calendarDate = dateFns.addMonths(this.state.currentMonth, 1) const calendarDate = dateFns.addMonths(this.state.currentMonth, 1)
this.updateStateDate(calendarDate) this.updateStateDate(calendarDate)
} }
handlePrevMonth () { handlePrevMonth() {
const calendarDate = dateFns.subMonths(this.state.currentMonth, 1) const calendarDate = dateFns.subMonths(this.state.currentMonth, 1)
this.updateStateDate(calendarDate) this.updateStateDate(calendarDate)
} }