JavaScript date from string?
<p>Novice question. I've got a string in the following format:</p>

<pre><code>var dateStr = '2012-4-14';
</code></pre>

<p>I want to make it into a JavaScript Date object. The following creates a Date object in Chrome, but is NaN in IE8:</p>

<pre><code>var myDate = new Date(dateStr);
</code></pre>

<p>What should I be doing differently - should I split the string?</p>

<p>Thanks!</p>
