<pre>function setAlarm(e) { e.preventDefault(); const alarm = document.getElementById('alarm'); alarmDate = new Date(alarm.value); console.log(`Setting Alarm for ${alarmDate}...`); here// now = new Date(); let timeToAlarm = alarmDate - now; console.log(timeToAlarm); if(timeToAlarm>=0){ setTimeout(() => { console.log("Ringing now") ringBell(); }, timeToAlarm); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)