]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix handling of moments by scale.getRightValue 2588/head
authorAllenJB <AllenJB@users.noreply.github.com>
Wed, 18 May 2016 16:38:20 +0000 (17:38 +0100)
committerAllenJB <AllenJB@users.noreply.github.com>
Wed, 18 May 2016 16:38:20 +0000 (17:38 +0100)
When using {x: moment, y: value} datapoints

src/core/core.scale.js

index e53265ed5c6d13fe2e81539c24ce683b4b081100..9861288cd33c93e2770351e2366416d9bd8ae3b0 100644 (file)
@@ -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);