From: Dan Vanderkam Date: Sat, 20 Feb 2010 01:57:34 +0000 (-0800) Subject: catch NaN dates like new Date("2009/10/00") in parseArray_ X-Git-Tag: v1.0.0~721 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=3a909ec56945357aa074c1f4b268c8d995bcde20;p=dygraphs.git catch NaN dates like new Date("2009/10/00") in parseArray_ --- diff --git a/dygraph.js b/dygraph.js index ba2f31e..6b1a99c 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1807,7 +1807,8 @@ Dygraph.prototype.parseArray_ = function(data) { return null; } if (parsedData[i][0] == null - || typeof(parsedData[i][0].getTime) != 'function') { + || typeof(parsedData[i][0].getTime) != 'function' + || isNaN(parsedData[i][0].getTime())) { this.error("x value in row " << (1 + i) << " is not a Date"); return null; }