title: Allow today's date and future date by comparing with today's date in javascript
body: <p>I have a entry form in which I can allow today's date and future date but can't allow yesterday and previous days. I need to do this validation using java-script on client side.</p>
  
  <pre><code>var futuredate = new Date($("#Deadline").val());
  var today = new Date();
  </code></pre>
  
  <p>This gives me date with time. <code>Mon Nov 04 2013 00:00:00 GMT+0530 (India Standard Time)</code>
  I want only date to compare as when user enters today's date 
  entered date is : <code>Fri Apr 05 2013 00:00:00 GMT+0530 (India Standard Time)</code>
  current date from new Date():<code>Fri Apr 05 2013 16:53:00 GMT+0530 (India Standard Time)</code></p>
  
  <p>I tried using <code>sethours()</code> it worked fine for current month, but as it converts date in number it creates problem when date entered is of previous or any before month. 
  for example: the date entered date is <code>23/3/2013</code> and today is <code>5/4/2013</code> it considers the entered date as valid.</p>
  
  <pre><code>var futuredate = new Date($("#Deadline").val()).setHours(0, 0, 0, 0);
  var today = new Date().setHours(0, 0, 0, 0);
  if (futuredate &gt;= today) {
     alert("Valid");
  }
  else if (futuredate &lt; today) {
     alert("InValid");
  }
  </code></pre>