$(document).ready(function(){ var today = new Date(); var cDay = new Date(); cDay = new Date(2013, 7, 01, 00, 00); if((today.getTime()+24*3600*1000) > cDay.getTime()){ $('#cd').countdown({until: cDay, compact: true, format: 'HMS', layout: '{hn}{sep}{mnn}{sep}{snn}'}); $('#cd1').countdown({until: cDay, compact: true, format: 'HMS', layout: '{hn}{sep}{mnn}{sep}{snn}'}); } else { $('#cd').countdown({until: cDay, compact: true, format: 'dHMS', layout: '{dn} dage, {hn}{sep}{mnn}{sep}{snn}'}); $('#cd1').countdown({until: cDay, compact: true, format: 'dHMS', layout: '{dn} dage, {hn}{sep}{mnn}{sep}{snn}'}); } var cDay2 = new Date(); cDay2 = new Date(2014, 7, 30, 20, 45); if((today.getTime()+24*3600*1000) > cDay2.getTime()){ $('#cd2').countdown({until: cDay2, compact: true, format: 'HMS', layout: '{hn}{sep}{mnn}{sep}{snn}'}); } else { $('#cd2').countdown({until: cDay2, compact: true, format: 'dHMS', layout: '{dn} dage, {hn}{sep}{mnn}{sep}{snn}'}); } });