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 for issue #4294 #4295

Merged
merged 1 commit into from May 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/scales/scale.time.js
Expand Up @@ -232,8 +232,9 @@ module.exports = function(Chart) {
var timeOpts = me.options.time;

// We store the data range as unix millisecond timestamps so dataMin and dataMax will always be integers.
var dataMin = Number.MAX_SAFE_INTEGER;
var dataMax = Number.MIN_SAFE_INTEGER;
// Integer constants are from the ES6 spec.
var dataMin = Number.MAX_SAFE_INTEGER || 9007199254740991;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any advantage to keep the constants here compared to simply hard code these values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only that it seems more future proof. It looks like Edge supports these, so in 'the future' the constants should be used everywhere and the hard coded values will never come into play. I've no strong opinion on this so let me know if you'd like it changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks!

var dataMax = Number.MIN_SAFE_INTEGER || -9007199254740991;

var chartData = me.chart.data;
var parsedData = {
Expand Down