Chłopki Siema, potrzebuję waszej pomocy. Odliczanie do określonej daty w JS, Jak dodać kilka dat by do nich się odwołać tak jak poniżej , z góry dziękuję za pomoc.
var countDownDateTime = new Date("Nov 04, 2017 18:00:00").getTime();
var myInterval = setInterval(function () { "use strict";
var currentDateTime = new Date().getTime();
var diff = countDownDateTime - currentDateTime;
var days = Math.floor(diff / (1000 * 60 * 60 * 24));
var hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((diff % (1000 * 60)) / 1000);
if (days<10) {days = '0' + days;}
if (hours<10) {hours ='0' + hours;}
if (minutes<10) {minutes ='0' + minutes;}
if (seconds<10) {seconds ='0' + seconds;}
// Show on HTML
document.getElementById("days").innerHTML = days;
document.getElementById("hours").innerHTML = hours;
document.getElementById("minutes").innerHTML = minutes;
document.getElementById("seconds").innerHTML = seconds;
// Do something when it completed.
if (diff < 0) {
clearInterval(myInterval);
var elem = document.getElementById("clear");
elem.parentNode.removeChild(elem);
}
}, 1000);