title: Date comparison after parsing is not working
body: <p>I am trying to hide a range of div elements that do not match a set date () after iterating through a set. But as the dates are in two different formats, I need to convert them to one standard format before making the comparison. Unfortunately, this is not working, although the dates match, all of the div elements are hidden. Does anybody know what is going wrong? Thanks.</p>
  
  <p>Jsfiddle: <a href="http://jsfiddle.net/ss308rwa/" rel="nofollow">http://jsfiddle.net/ss308rwa/</a></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input type="text" class="form-control date" value="04/06/2015"&gt;
  &lt;button type="button" class="btn btn-primary" id="search-button"&gt;Search&lt;/button&gt;
  &lt;div class="rideshare-item" data-date="2015-06-04"&gt;04/06/2015&lt;/div&gt;
  &lt;div class="rideshare-item" data-date="2015-06-05"&gt;05/06/2015&lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$('body').on('click', '#search-button', function (event) {
      var date = $('.date').val().trim();
      $('.rideshare-item, .no-result').hide();
      $('.rideshare-item').each(function (a, b) {
          var rideshareDate = $(b).data('date');
          if (date.length == 0) {
              $(this).closest('.rideshare-item').show();
          } else if (date.length &gt; 0) {
              var timestamp = Date.parse(date)
              if (isNaN(timestamp) == false) {
                  if (parseDateEntry(date) == parseDateAttribute(rideshareDate)) {
                      $(this).closest('.rideshare-item').show();
                  }
              }
          }
      });
  });
  
  function parseDateEntry(input) {
      var parts = input.split('/');
      // new Date(year, month [, day [, hours[, minutes[, seconds[, ms]]]]])
      return new Date(parts[2], parts[1] - 1, parts[0]);
  }
  
  function parseDateAttribute(input) {
      var parts = input.split('-');
      // new Date(year, month [, day [, hours[, minutes[, seconds[, ms]]]]])
      return new Date(parts[0], parts[1] - 1, parts[2]);
  }
  </code></pre>