title: Uncaught TypeError: Cannot read property 'getTime' of undefined in CanvasJS
body: <p>I am facing an issue when updating the datapoints of CanvasJS chart, and the error message says </p>
  
  <blockquote>
    <p>“Uncaught TypeError: Cannot read property ‘getTime’ of undefined”.</p>
  </blockquote>
  
  <p>I tried also make it an object like this </p>
  
  <pre><code>var parLabels = JSON.stringify(labels);     
  var obj = JSON.parse(parLabels);
  </code></pre>
  
  <p>It still didn't work.</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;div id="chartContainer" style="height: 300px; width: 100%;"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript&gt;
  $(function() {
    google.script.run.withSuccessHandler(showDaily).getData();
  });
  function showDaily(myObj) {
    var email = myObj.email;
    var entity = myObj.entity;
    var entity = JSON.parse(entity);
    var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
    var labels = '';
    for (var i = 1; i &lt; entity.length; i++) {
      var month = new Date(entity[i][0]).getMonth();
      var day = new Date(entity[i][0]).getDate();
      var date = day + " " + monthNames[month];
      var score = entity[i][7];
      if (entity[i][2] != '') {
        if (labels != "") {
          labels = labels + ",{label:" + date + ",y:" + score + "}";
        } else {
          labels = "{label:" + date + ",y:" + score + "}";
        }
      }
    }
    var chart = new CanvasJS.Chart("chartContainer", {
      title: {
          text: "My First Chart in CanvasJS"              
      },
      data: [              
      {
          // Change type to "doughnut", "line", "splineArea", etc.
          type: "line",
          dataPoints: [ labels ]
      }
      ]
    });
    chart.render();
  }
  
  &lt;/script&gt;
  </code></pre>