title: How to check for one date is less than or equal another date in Javascript
body: <p>I am having a difficult time checking if one date is less than or equal to another.</p>
  
  <p>Here is my code,</p>
  
  <pre><code>var bftStartDt = input1[0]; //This is a string with value "01-Jul-2007"
  var bftEndDt = input1[4]; //This is a string with value "01-Jul-1942"
  
  var strtDt = new Date(bftStartDt);
  var endDt = new Date(bftEndDt);
  var flag = 0; // false
  
  if (endDt &lt;= strtDt){
     flag = 1; // true
  }
  </code></pre>
  
  <p>It never enters the if statement when it should ? What am I missing here.</p>
  
  <p>Thanks</p>