title: AmCharts - cannot read property of 'time' of undefined
body: <p>I am using AmCharts. Everything is working fine except that when I try to put my own date objects in data, it won't work. But their example is working, still I did exactly what they did.</p>
  
  <p>This is how I return my data (not working)</p>
  
  <pre><code>var d1 = new Date();
  d1.setDate(d1.getDate() + 2);
  
  var d2 = new Date();
  d2.setDate(d2.getDate() + 6);
  
  chartData = 
  [ 
      {"date":d1, "visits":150},
      {"date":d2, "visits":155}
  ];
  return chartData;
  </code></pre>
  
  <p>This is how they return data in example (working)</p>
  
  <pre><code>var chartData = [];
  var firstDate = new Date();
  firstDate.setDate(firstDate.getDate() - 150);
  
  for (var i = 0; i &lt; 150; i++) {
  
      var newDate = new Date(firstDate);
      newDate.setDate(newDate.getDate() + i);
  
      var visits = Math.round(Math.random() * 100 - 50);
  
      chartData.push({
          date: newDate,
          visits: visits
      });
  }
  return chartData;
  </code></pre>
  
  <p>I can't understand why am I getting an error in my console (Uncaught TypeError: Cannot read property 'time' of undefined)</p>