Skip to content

Commit

Permalink
fix: scrollToTime does not work properly, when min specified (#2051)
Browse files Browse the repository at this point in the history
Fixed a bug that prevented scrollToTime does not working properly, when min specified.
  • Loading branch information
hiroro-work authored Jun 5, 2023
1 parent 5684f04 commit 04c1888
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TimeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export default class TimeGrid extends Component {
calculateScroll(props = this.props) {
const { min, max, scrollToTime, localizer } = props

const diffMillis = scrollToTime - localizer.startOf(scrollToTime, 'day')
const diffMillis = localizer.diff(localizer.merge(scrollToTime, min), scrollToTime, 'milliseconds')
const totalMillis = localizer.diff(min, max, 'milliseconds')

this._scrollRatio = diffMillis / totalMillis
Expand Down

0 comments on commit 04c1888

Please sign in to comment.