Skip to content

Commit

Permalink
fix: Correct scrollToTime functionailty
Browse files Browse the repository at this point in the history
Fix the calculateScroll method in the TimeGrid

jquense#2028 jquense#1717
  • Loading branch information
cutterbl committed Nov 8, 2021
1 parent c75ad1a commit 3c7f098
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/TimeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3c7f098

Please sign in to comment.