title: jQuery: pass string variable to date object
body: <p>I have a page with a number of variables that contain a <strong>date in string format (yyyy-mm-dd)</strong> which originates from using moment.js. </p>
  
  <p>Is there a way I can pass such a variable to a Javascript date object resp. to convert it to a Javascript date object ?
  I am not interested in the time so as long as I can get the date converted to a date object that would be great. </p>
  
  <p>I tried the following but this doesn't work and I couldn't find a way using moment.js: </p>
  
  <pre><code>var newVar = new Date(dateVar);
  </code></pre>
  
  <p>Many thanks for any help with this, Tim.</p>