title: AngularJS/javascript converting a date String to date object
body: <p>Im stuck on a problem and would appreciate any help. I have read through lot of the discussions already but they dont seem to work for me. </p>
  
  <pre><code>//I have a date as a string which I want to get to a date format of dd/MM/yyyy
  var collectionDate = '2002-04-26T09:00:00'; 
  
  //used angularjs date filter to format the date to dd/MM/yyyy
  collectionDate = $filter('date')(collectionDate, 'dd/MM/yyyy'); //This outputs 26/04/2002 as a string
  </code></pre>
  
  <p>How do I convert it to a date object? The reason I want to do this is because I want to use it in a google charts directive where one of the columns has to be a date. I do not want to have the column type as string: </p>
  
  <p>eg: </p>
  
  <pre><code>var data = new google.visualization.DataTable();
                      data.addColumn('date', 'Dates');
                      data.addColumn('number', 'Upper Normal');
                      data.addColumn('number', 'Result');
                      data.addColumn('number', 'Lower Normal');
                      data.addRows(scope.rows);.................
  </code></pre>