Skip to content

Commit c77757f

Browse files
committed
Focus on current date month
1 parent 92c17d6 commit c77757f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@ export default class Dates extends Component {
250250
}
251251
props: DatesType;
252252

253+
componentWillMount() {
254+
const currentDate = moment(this.props.date)
255+
const focusedMonth = moment(this.props.date).startOf('month')
256+
257+
this.setState({
258+
currentDate: currentDate,
259+
focusedMonth: focusedMonth
260+
})
261+
}
262+
253263
render() {
254264
const previousMonth = () => {
255265
this.setState({ focusedMonth: this.state.focusedMonth.add(-1, 'M') });

0 commit comments

Comments
 (0)