Javascript date format using string month
<p>All the other topics on date format assume that dates are entered as integers.</p>

<p>I'm writing a script (Linux) that requires the month to be a string (Jan, Feb, Mar etc) and need to validate the dates.</p>

<p>I've written a clunky routine that extracts the month, determines the month number and then does the comparison but I was hoping there might be something neater out there to do this? I thought I had seen something about using a 'format' method but I can't find it now...</p>

<p>I've tried this but it fails miserably:</p>

<pre><code>var checkDate1 = document.getElementById('fromDate').value;
var checkDate2 = document.getElementById('toDate').value;

tmpDate1 = new Date(checkDate1);
tmpDate2 = new Date(checkDate2);

if (tmpDate1 &lt; tmpDate2) {
</code></pre>

<p>where a typical field entry will be '12-may-2012', for example.</p>

<p>NOTE: I don't have access to add any fancy, whizzy libraries to the system so have to make do with the vanilla stuff.</p>
