Skip to content

Commit

Permalink
fix: added fallback to getNow (#1140)
Browse files Browse the repository at this point in the history
When view changed and props `date === undefined` we have unexpected behavior for `handleRangeChange` and then for `onRangeChange` methods. It returns sometimes `undefined` and sometimes `Invalid Date`, so I suggest fix for this to provide default date if `date` prop isn't present.
  • Loading branch information
valeryq authored and jquense committed Dec 5, 2018
1 parent 07b2fa4 commit 13459b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ class Calendar extends React.Component {
}

let views = this.getViews()
this.handleRangeChange(this.props.date, views[view], view)
this.handleRangeChange(this.props.date || this.props.getNow(), views[view], view)
}

handleSelectEvent = (...args) => {
Expand Down

0 comments on commit 13459b0

Please sign in to comment.