Users Pricing

forum

Home Forums How to countdown, 24hour and rules for weekends in jquery? – MindStick

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

Anonymous User 2092 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);


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md