From c4d508e9b2f50808b5b1c8d9c5a9e307e1e9eecf Mon Sep 17 00:00:00 2001 From: hiroro-work Date: Wed, 27 Oct 2021 21:06:41 +0900 Subject: [PATCH 1/2] fix: scrollToTime does not work properly --- src/TimeGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TimeGrid.js b/src/TimeGrid.js index b4220106b..ae4c8f737 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -314,7 +314,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(scrollToTime, localizer.merge(scrollToTime, min)) const totalMillis = localizer.diff(max, min) this._scrollRatio = diffMillis / totalMillis From 1d582d0dc4c5f34f75b3e18aa7d9406132ce21e4 Mon Sep 17 00:00:00 2001 From: hiroro-work Date: Fri, 19 Nov 2021 21:33:16 +0900 Subject: [PATCH 2/2] fix a bit --- src/TimeGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TimeGrid.js b/src/TimeGrid.js index bf9fe8daf..8ff9997ba 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -314,7 +314,7 @@ export default class TimeGrid extends Component { calculateScroll(props = this.props) { const { min, max, scrollToTime, localizer } = props - const diffMillis = localizer.diff(scrollToTime, localizer.merge(scrollToTime, min)) + const diffMillis = localizer.diff(localizer.merge(scrollToTime, min), scrollToTime, 'milliseconds') const totalMillis = localizer.diff(min, max, 'milliseconds') this._scrollRatio = diffMillis / totalMillis