Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scrollToTime #2055

Merged
merged 17 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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