From 3c7f0989fd839a4f0493d7500ac8373849ae2652 Mon Sep 17 00:00:00 2001 From: "Blades, Stephen" Date: Mon, 8 Nov 2021 16:05:54 -0600 Subject: [PATCH] fix: Correct scrollToTime functionailty Fix the calculateScroll method in the TimeGrid #2028 #1717 --- package.json | 2 +- src/TimeGrid.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fe900475c..2bfc13c88 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "build:cjs": "babel src --out-dir lib", "build": "yarn clean && yarn build:cjs && yarn build:umd && yarn assets && yarn build:css", "build:examples": "yarn clean:examples && webpack --config examples/webpack.config.js", - "examples": "yarn clean:examples && webpack-dev-server --config examples/webpack.config.js --mode development", + "examples": "yarn clean:examples && webpack-dev-server --config examples/webpack.config.js --mode development --host 0.0.0.0 --hot --open --useLocalIp", "lint": "eslint src test", "storybook": "start-storybook -p 9002", "test": "yarn lint && jest", diff --git a/src/TimeGrid.js b/src/TimeGrid.js index b4220106b..b250b83b5 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -315,7 +315,7 @@ export default class TimeGrid extends Component { const { min, max, scrollToTime, localizer } = props const diffMillis = scrollToTime - localizer.startOf(scrollToTime, 'day') - const totalMillis = localizer.diff(max, min) + const totalMillis = localizer.diff(min, max, 'milliseconds') this._scrollRatio = diffMillis / totalMillis }