title: Comparing date part only without comparing time in JavaScript
body: <p>What is wrong with the code below?</p>
  
  <p>Maybe it would be simpler to just compare date and not time. I am not sure how to do this either, and I searched, but I couldn't find my exact problem.</p>
  
  <p>BTW, when I display the two dates in an alert, they show as exactly the same.</p>
  
  <p>My code:</p>
  
  <pre><code>window.addEvent('domready', function() {
      var now = new Date();
      var input = $('datum').getValue();
      var dateArray = input.split('/');
      var userMonth = parseInt(dateArray[1])-1;
      var userDate = new Date();
      userDate.setFullYear(dateArray[2], userMonth, dateArray[0], now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
  
      if (userDate &gt; now)
      {
          alert(now + '\n' + userDate);
      }
  });
  </code></pre>
  
  <p>Is there a simpler way to compare dates and not including the time?</p>