Looking to update the code once the timer (See code) has run out. Currently, I am working on an exciting auction project for a friend and when the timer expires, I want to change the page so that no more bids can be placed. All bids are time-sensitive, so I could manually check if any bids were placed after expiration, but that seems cumbersome. It would be great if it could be done automatically. Currently, it displays "EXPIRED!" when the timer ends, but what should I replace it with to prevent further bidding?
If you need to see more code, please let me know. Thank you in advance.
CountDownTimer('01/31/2016 7:1 PM', 'countdown');
function CountDownTimer(dt, id)
{
var end = new Date(dt);
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(id).innerHTML = '<span class="date">EXPIRED!</span>';
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(id).innerHTML = 'Time Left = ';
document.getElementById(id).innerHTML += '<span class="date">' + days + ' D</span>';
document.getElementById(id).innerHTML += '<span class="date">' + hours + ' H</span>';
document.getElementById(id).innerHTML += '<span class="date">' + minutes + ' M</span>';
// document.getElementById(id).innerHTML += '<span class="date">' + seconds + ' S</span>';
}
timer = setInterval(showRemaining, 1000);
}