// swsn: ISWIsion-Namespace // // Initialize variables var swsn = { shows: [ // duration and offset are given in minutes! { name: 'Show1_SA', date: new Date(1433005200000), duration: 0, offset: 0 }, { name: 'Show2_SO', date: new Date(1433091600000), duration: 300, offset: 0 }, { name: 'Show3_MO', date: new Date(1433178000000), duration: 0, offset: 0 }, { name: 'Show4_DI', date: new Date(1433268000000), duration: 300, offset: 0 }, { name: 'Show5_MI', date: new Date(1433350800000), duration: 90, offset: 0 }, { name: 'Show6_DO', date: new Date(1433437200000), duration: 90, offset: 0 }, { name: 'Show7_FR', date: new Date(1433523600000), duration: 90, offset: 0 }, { name: 'Show8_SA', date: new Date(1433610000000), duration: 90, offset: 0 }, { name: 'ISWIsion2017', date: new Date(1496509200000), duration: 90, offset: 0 } ], day: 86400000, hour: 3600000, minute: 60000, second: 1000 }; swsn.activateTimezone = function () { //console.log('activateTimezone()'); var strTime; var show = this.shows[0].date; var hours = show.getHours(); var minutes = show.getMinutes(); var offset = show.getTimezoneOffset(); var ampm = hours >= 12 ? 'pm' : 'am'; hours = hours % 12; hours = hours ? hours : 12; // the hour '0' should be '12' strTime = hours + ' ' + ampm; if(offset%60!=0){ minutes = minutes < 10 ? '0'+minutes : minutes; strTime = hours + ':' + minutes + ' ' + ampm; } //console.log(strTime); $('.swsn-showtime').html(strTime); $('.swsn-slogan-zone').removeClass('swsn-hidden'); }; swsn.checkCountdown = function () { //console.log('checkCountdown()'); var t = new Date(); // Get the current date for(var i=0; i