8000 Fix bar lengths in milliseconds from base by archmoj · Pull Request #4900 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Fix bar lengths in milliseconds from base #4900

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

Merged
merged 7 commits into from
Jun 5, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix milliseconds not to depend on timezone
  • Loading branch information
archmoj committed Jun 3, 2020
commit 2087766a28159136f9828d80e9c617758d6945c7
5 changes: 4 additions & 1 deletion src/plots/cartesian/set_convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ module.exports = function setConvert(ax, fullLayout) {
// same logic as in Lib.ms2DateTime
var msecTenths = Math.floor(Lib.mod(v + 0.05, 1) * 10);
var msRounded = Math.round(v - msecTenths / 10);
ms = dateTime2ms(new Date(msRounded)) + msecTenths / 10;

var d = new Date(msRounded);
ms = dateTime2ms(d) + msecTenths / 10;
ms += d.getTimezoneOffset() * ONEMIN;
} else return BADNUM;
}
return ms;
Expand Down
0