Fix handling of moments by scale.getRightValue

When using {x: moment, y: value} datapoints
This commit is contained in:
AllenJB 2016-05-18 17:38:20 +01:00
parent 529ebedc90
commit 966d737617

View File

@ -396,7 +396,7 @@ module.exports = function(Chart) {
} }
// If it is in fact an object, dive in one more level // If it is in fact an object, dive in one more level
if (typeof(rawValue) === "object") { if (typeof(rawValue) === "object") {
if (rawValue instanceof Date) { if ((rawValue instanceof Date) || (rawValue.isValid)) {
return rawValue; return rawValue;
} else { } else {
return getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y); return getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);