From 04c18886f46acd17f09dec5d73a06bc32e6c75e5 Mon Sep 17 00:00:00 2001 From: Masato Hirokami <40903780+hiroro-work@users.noreply.github.com> Date: Mon, 5 Jun 2023 20:39:03 +0900 Subject: [PATCH] fix: scrollToTime does not work properly, when min specified (#2051) Fixed a bug that prevented scrollToTime does not working properly, when min specified. --- src/TimeGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TimeGrid.js b/src/TimeGrid.js index 79d991ac4..90e4029dd 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -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