title: Jquery check if date is current date or passed
body: <p>I am not using the date picker, I have a string that outputs a date the following way:</p>
  
  <p><code>&lt;span class="expiry-date"&gt;30-Jun-2014&lt;/span&gt;</code> (can't do anything about that, so I have to work with that)</p>
  
  <p>I am checking the current date and output it so that it matches this particular string:</p>
  
  <pre><code> var d = new Date();
  
  var day = d.getDate();
  
  var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
      "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"
  ];
  
  var month = monthNames[d.getMonth()];
  
  
  var output = (('' + day).length &lt; 2 ? '0' : '') + day + '-' + (('' + month).length &lt; 2 ? '0' : '') + month + '-' + d.getFullYear();
  </code></pre>
  
  <p>then I am trying to compare the two, to see if the date in "expiry-date" is the current date or already  passed:</p>
  
  <pre><code> var expiryDate = $('.expiry-date').text();
  
        if ($('.expiration-settings').text() == "1"){
  
        }else{
      if (output &gt;= expiryDate) {
          $('.event-price, #event-registration').hide();
          $('.expiry-date').text('This event is no longer open for registration');
      } else {
          $('.expiry-date').hide();
      }
             }
  </code></pre>
  
  <p><a href="https://event-booking-test.worldsecuresystems.com/events-1/event-1" rel="nofollow">Live demo</a></p>
  
  <p>I am doing something wrong, because it only checks the day (numeric, understandable, but I am not sure how to fix this so it actually checks the date and not only a number.)</p>
  
  <p>Any ideas? Thanks!</p>
  
  <p>Edit: I changed the <a href="https://event-booking-test.worldsecuresystems.com/events-1/event-1" rel="nofollow">DEMO</a> so its easier to see what I need to do. </p>