Title
Coming Soon
// For picking date :
let theDate = "Jan 1, 2025 13:00:00";
let showTitle;
let showHere;
function recordDate(){
let d = document.getElementById("date").value;
let t = document.getElementById("title").value;
if( t == "" ){
alert("Enter a Title for your Meeting")
showTitle = document.getElementById("ici").innerHTML = "no title";
}else{
showTitle = document.getElementById("ici").innerHTML = t;
showHere = document.getElementById("show").innerHTML = d;
theDate = document.getElementById("here").innerHTML = d;
}
}
// End function
const countdown = document.querySelector('.countdown');
// Update every second
const intvl = setInterval(() => {
let launchDate = new Date(theDate);
// Get todays date and time (ms)
const now = new Date().getTime();
// Distance from now and the launch date (ms)
let distance = launchDate - now;
// Time calculation
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const mins = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display result
countdown.innerHTML = `
< div>${days}< span>Days>>
< div>${hours}< span>Hours>>
< div>${mins}< span>Minutes>>
< div>${seconds}< span>Seconds>>
`;
// If launch date is reached
if (distance < 0) {
// Stop countdown
clearInterval(intvl);
// Style and output text
countdown.style.color = '#17a2b8';
let d = new Date();
let wd = d.getDay();
let weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
let n = weekday[d.getDay()];
let mounth = new Array(12);
mounth[0] = "January";
mounth[1] = "February";
mounth[2] = "March";
mounth[3] = "April";
mounth[4] = "May";
mounth[5] = "June";
mounth[6] = "July";
mounth[7] = "August";
mounth[8] = "September";
mounth[9] = "October";
mounth[10] = "November";
mounth[11] = "December";
let m = mounth[d.getMonth()];
let y = d.getFullYear();
countdown.innerHTML = `On that ${n} ${wd} ${m} ${y} It's Launched!`;
}
}, 1000); // setInterval