From: AllenJB Date: Wed, 18 May 2016 16:38:20 +0000 (+0100) Subject: Fix handling of moments by scale.getRightValue X-Git-Tag: v2.1.4~17^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F2588%2Fhead;p=thirdparty%2FChart.js.git Fix handling of moments by scale.getRightValue When using {x: moment, y: value} datapoints --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index e53265ed5..9861288cd 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -396,7 +396,7 @@ module.exports = function(Chart) { } // If it is in fact an object, dive in one more level if (typeof(rawValue) === "object") { - if (rawValue instanceof Date) { + if ((rawValue instanceof Date) || (rawValue.isValid)) { return rawValue; } else { return getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);