MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

var end = new Date('03/22/2016 16:00');

var _second = 1000; var _minute = _second * 60; var _hour = _minute * 60; var _day = _hour * 24; var timer;

function showRemaining { var now = new Date; var distance = end - now; if (distance < 0) {

clearInterval(timer); document.getElementById('countdown').innerHTML = 'EXPIRED!';

return; }       var days = Math.floor(distance / _day); var hours = Math.floor((distance % _day) / _hour); var minutes = Math.floor((distance % _hour) / _minute); var seconds = Math.floor((distance % _minute) / _second);

document.getElementById('countdown').innerHTML = days + 'days '; document.getElementById('countdown').innerHTML += hours + 'hrs '; document.getElementById('countdown').innerHTML += minutes + 'mins '; document.getElementById('countdown').innerHTML += seconds + 'secs'; }

timer = setInterval(showRemaining, 1000);