Commit 6dbf5885 authored by Ranjith Raj's avatar Ranjith Raj

Merge branch 'patch-1' into 'master'

TIME COUNTER

See merge request !1
parents a903b54d f45bed95
var countDownDate1 = new Date("May 27, 2018 09:00:00").getTime();
var msg1 ="<center><h3 id='rem'></h3></center><br>";
document.body.innerHTML="<br><br><center><h1 id='h1'>CAMP BEGINS </h1></center>";
document.getElementById("h1").style.fontStyle = "italic";
document.getElementById("h1").style.bgcolor = "red";
document.body.innerHTML += msg1;
var rem=document.getElementById('rem');
var x = setInterval(function() {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance = countDownDate1 - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="demo"
document.getElementById('rem').innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s ";
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
rem.innerHTML = "EXPIRED";
}
}, 1000);
var countDownDate2 = new Date("June 25, 2018 09:00:00").getTime();
var msg2 ="<center><h3 id='dem'></h3></center></br>";
document.body.innerHTML +="<center><h1 id='a'>CAMP ENDS</h1></center";
document.getElementById("a").style.fontStyle = "italic";
document.body.innerHTML += msg2;
var dem=document.getElementById('dem');
var y = setInterval(function() {
// Get todays date and time
var now2 = new Date().getTime();
// Find the distance between now an the count down date
var distance2 = countDownDate2 - now2;
// Time calculations for days, hours, minutes and seconds
var days2 = Math.floor(distance2 / (1000 * 60 * 60 * 24));
var hours2 = Math.floor((distance2 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes2 = Math.floor((distance2 % (1000 * 60 * 60)) / (1000 * 60));
var seconds2 = Math.floor((distance2 % (1000 * 60)) / 1000);
// Output the result in an element with id="demo"
dem.innerHTML = days2 + "d " + hours2 + "h "
+ minutes2 + "m " + seconds2 + "s ";
// If the count down is over, write some text
if (distance2 < 0) {
clearInterval(y);
dem.innerHTML = "EXPIRED";
}
}, 1000);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment