Skip to content

Commit

Permalink
Merge pull request #85835 from cockroachdb/blathers/backport-release-…
Browse files Browse the repository at this point in the history
…22.1-85809

release-22.1: ui: fix time window selection with mouse on Metrics charts
  • Loading branch information
koorosh authored Aug 10, 2022
2 parents e8a6797 + 9955bf9 commit d0ad364
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,11 @@ export class LineGraph extends React.Component<LineGraphProps, {}> {
start: moment.unix(start),
end: moment.unix(end),
};
const seconds = moment.duration(moment.utc(end).diff(start)).asSeconds();
let newTimeScale: TimeScale = {
...findClosestTimeScale(defaultTimeScaleOptions, end - start, start),
...findClosestTimeScale(defaultTimeScaleOptions, seconds),
key: "Custom",
windowSize: moment.duration(moment.unix(end).diff(moment.unix(start))),
fixedWindowEnd: moment.unix(end),
};
if (this.props.adjustTimeScaleOnChange) {
Expand Down

0 comments on commit d0ad364

Please sign in to comment.