simple javascript code to calculate a countdown

I’m trying to edit following code to get the output I want.

function zoo_countdown_end_day() {
    if ($('.zoo-get-order-notice .end-of-day')[0]) {
        var offset = $('.end-of-day').data('timezone');
        var day = new Date();
        var utc = day.getTime() + (day.getTimezoneOffset() * 60000);
        let d = new Date(utc + (3600000*offset)),
        duration = 60 * (60 - d.getMinutes());
        let timer = duration, minutes;
        let hours = (23 - d.getHours());//kumudu edited this
        hours = hours < 10 ? '0' + hours : hours;
        let label_h = $('.zoo-get-order-notice .end-of-day').data('hours');
        let label_m = $('.zoo-get-order-notice .end-of-day').data('minutes');
        setInterval(function () {
            minutes = parseInt(timer / 60, 10);
            minutes = minutes < 10 ? "1" + minutes : minutes;
            $('.zoo-get-order-notice .end-of-day').text(hours + ' ' + label_h + ' ' + minutes + ' ' + label_m);
            if (--timer < 0) {
                timer = duration;
            }
        }, 1000);
    }
}
zoo_countdown_end_day();
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="zoo-get-order-notice">
    <span class="end-of-day"
          data-timezone="+3"
          data-hours="1"
          data-minutes="3"></span>
</div>

This is the current output:

enter image description here

I just want to edit countdown time to countdown from next day 4.00 P.M (hours and minuets). Because I offer next day shipping.

143 thoughts on “simple javascript code to calculate a countdown”

  1. Pingback: viagra cheap
  2. Pingback: viagra 100mg
  3. Pingback: viagra cost
  4. Pingback: purchase viagra
  5. Pingback: purchase cialis
  6. Pingback: sildenafil uk
  7. Pingback: viagra
  8. Pingback: discount viagra
  9. Pingback: womens viagra
  10. Pingback: cost of otc viagra
  11. Pingback: walmart cialis
  12. Pingback: cialis dosages
  13. Pingback: sildenafilo
  14. Pingback: whats viagra
  15. Pingback: viagra men
  16. Pingback: viagra kaufen
  17. Pingback: pfizer viagra
  18. Pingback: viagras
  19. Pingback: cvs viagra
  20. Pingback: generic for viagra
  21. Pingback: sildenafil price
  22. Pingback: viagra generic
  23. Pingback: viagra pornhub
  24. Pingback: teva sildenafil

Leave a Comment