title: jQuery if date true, change class of element x
body: <p>Now I have two more questions and have updated my code.</p>
  
  <ol>
  <li>I have this if (releaseDate &lt;= today), why is the Date 15.05.2015 success?! </li>
  <li>When I want to check dates with time example: 25.04.2015 - 09.00 am, how  can I check that with today and when date is over 25.04.2015 == true.</li>
  </ol>
  
  <p>My code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script src="https://code.jquery.com/jquery.js"&gt;&lt;/script&gt; 
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  var releaseDate = {};
  
  jQuery(".state").each(function() {
   releaseDate = jQuery(this).text() 
      
   var today = new Date();
      var dd = today.getDate();
      var mm = today.getMonth()+1;
      var yyyy = today.getFullYear();
   var hh = today.getHours();
    
      if(dd&lt;10){
          dd='0'+dd
      } 
      if(mm&lt;10){
          mm='0'+mm
      } 
   var today = dd+'.'+mm+'.'+yyyy; 
    
   if (releaseDate &lt;= today) {
     jQuery(this).parent().next().find('span.label').addClass('label-success').removeClass('label-warning');
     jQuery(this).parent().next().find('span.label').text('Online');
   }     
    });
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"&gt;
  
  &lt;table class="table table-hover"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th align="center" valign="middle"&gt;&lt;strong&gt;Shop&lt;/strong&gt;&lt;/th&gt;
        &lt;th align="center" valign="middle"&gt;&lt;strong&gt;Date&lt;/strong&gt;&lt;/th&gt;
        &lt;th align="center" valign="middle"&gt;&lt;strong&gt;Status&lt;/strong&gt;&lt;/th&gt;
        &lt;th align="center" valign="middle"&gt;&lt;strong&gt;Link&lt;/strong&gt;&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td align="center" valign="middle"&gt;&lt;a href="#" rel="nofollow"&gt;LINK&lt;/a&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;span class="state"&gt;15.05.2015&lt;/span&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;span class="label label-warning"&gt;Upcoming&lt;/span&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;a class="btn btn-info btn-sm" href="#" title="#" target="_blank"&gt;&lt;strong&gt;LINK &lt;span class="glyphicon glyphicon-share-alt"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td align="center" valign="middle"&gt;&lt;a href="#" rel="nofollow"&gt;LINK&lt;/a&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;span class="state"&gt;25.04.2015&lt;/span&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;span class="label label-warning"&gt;Upcoming&lt;/span&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;a class="btn btn-info btn-sm" href="#" title="#" target="_blank"&gt;&lt;strong&gt;LINK &lt;span class="glyphicon glyphicon-share-alt"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td align="center" valign="middle"&gt;&lt;a href="#" rel="nofollow"&gt;LINK&lt;/a&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;span class="state"&gt;30.04.2015&lt;/span&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;span class="label label-warning"&gt;Upcoming&lt;/span&gt;&lt;/td&gt;
        &lt;td align="center" valign="middle"&gt;&lt;a class="btn btn-info btn-sm" href="#" title="#" target="_blank"&gt;&lt;strong&gt;LINK &lt;span class="glyphicon glyphicon-share-alt"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I hope someone can explain or show me that!</p>