Users Pricing

forum

home / developersection / forums / how to countdown, 24hour and rules for weekends in jquery?

How to countdown, 24hour and rules for weekends in jquery?

Anonymous User 2037 28 Jan 2015

Ive added the code in here When it hits friday after 11.00 it should countdown to money @ 11.00 Any suggestions / help to get here? Also: The CountDown-timer should also be able to check if its a holiday here in Denmark (not sure about this function, maybe a database to control that part, because the holidays will come in variables hmm?)

HTML:

<div id="countdown"></div>

JavaScript
function ShowTime() {
    var now = new Date();
    if (now.getHours() > 11) {
        var hrs = 11 - now.getHours() + 24;
    } else {
        var hrs = 11 - now.getHours();
    }
    var mins = 60 - now.getMinutes();
    var secs = 60 - now.getSeconds();
 
    timeLeft = "You now have " + hrs + ' Hour(s) ' + mins + ' minuts ' + secs + ' seconds' + " To complete the order, and make sure the delivery will reach to you in 1-3 days";
    $("#countdown").html(timeLeft);
}
 
var countdown;
 
function StopTime() {
    clearInterval(countdown);
 
}
 
setInterval(ShowTime, 1000);


I am a content writter !


1 Answers