Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
JS daily countdown timer UTC +1

Good morning,

I'm trying to put on my website a timer, that reset evey day at 00:00 UTC +1 (Rome), and start again. The fact is that is more complex than this... The timer need to start at 00:00. On the website, ppl will see 23:00:00 remaining. For the one hour remaining until 00:00, so from 23:00 until 00:00, on the website ppl will see "Results will be published within one hour, the game will restart in "countdown one hour"" and at 00:00 everything will resset.

the JS code that I have from my template is:

    if (plugins.countDown.length) {
        var d;
        for (i = 0; i < plugins.countDown.length; i++) {

            var countDownItem = plugins.countDown[i],
                    d = new Date(),
                    time = countDownItem.getAttribute('data-time'),
                    type = countDownItem.getAttribute('data-type'), // {until | since}
                    format = countDownItem.getAttribute('data-format') ? countDownItem.getAttribute('data-format') : 'YYYY/MM/DD hh:mm:ss',
                    expiryText = countDownItem.getAttribute('data-expiry-text') ? countDownItem.getAttribute('data-expiry-text') : 'Countdown finished',
                    labels = countDownItem.getAttribute('data-labels') ? countDownItem.getAttribute('data-labels') : '',
                    layout = countDownItem.getAttribute('data-layout') ? countDownItem.getAttribute('data-layout') : '{yn} {yl} {on} {ol} {dn} {dl} {hnn}{sep}{mnn}{sep}{snn}',
                    settings = [];


            if (labels.length > 0) {
                settings['labels'] = JSON.parse(labels);
            }

            d.setTime(Date.parse(time)).toLocaleString();
            settings[type] = d;
            settings['expiryText'] = expiryText;
            settings['format'] = format;
            settings['alwaysExpire'] = true;
            settings['padZeroes'] = true;
            settings['layout'] = layout;
            settings['onExpiry'] = function () {
                this.classList += ' countdown-expired';
                this.innerHtml = expiryText;
            };

            $(countDownItem).countdown(settings);
        }
    }

just a simple count down.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda