title: JavaScript on IE and Firefox
body: <p>I have this very simple function that doesnt work on Firefox or IE. Just wondering if you have some insight.</p>
  
  <pre><code>function compareDates(obj, fecha){
      var date1 = new Date( Date.parse(obj.value.replace(/-/g, " ")) );   
      var date2 = new Date( Date.parse(fecha.value.replace(/-/g, " ")) );
  
      if(date1 &lt; date2){
          alert("Invalid Date");
      }
  }
  </code></pre>
  
  <p>This function receives a <code>10-JUL-13</code> and a <code>20-JUL-13</code>, for examples.</p>
  
  <p>In IE, I don't get the alert, in Chrome, I do get the alert. Please see <a href="http://jsfiddle.net/ZDtVv/" rel="nofollow">http://jsfiddle.net/ZDtVv/</a></p>