Skip to content

Commit 6ce8391

Browse files
author
Jiri Kolarik
authored
Merge pull request #24 from eta-ai/focus-selected-month
Focus on current date month
2 parents 92c17d6 + 7e1e6cd commit 6ce8391

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ export default class Dates extends Component {
248248
currentDate: moment(),
249249
focusedMonth: moment().startOf('month')
250250
}
251+
252+
componentWillMount() {
253+
const currentDate = moment(this.props.date);
254+
const focusedMonth = moment(this.props.date).startOf('month');
255+
256+
this.setState({ currentDate, focusedMonth });
257+
}
258+
251259
props: DatesType;
252260

253261
render() {

0 commit comments

Comments
 (0)