catch NaN dates like new Date("2009/10/00") in parseArray_
authorDan Vanderkam <danvdk@gmail.com>
Sat, 20 Feb 2010 01:57:34 +0000 (17:57 -0800)
committerDan Vanderkam <danvdk@gmail.com>
Sat, 20 Feb 2010 01:57:34 +0000 (17:57 -0800)
dygraph.js

index ba2f31e..6b1a99c 100644 (file)
@@ -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;
       }