We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ced47d commit bf7dfb9Copy full SHA for bf7dfb9
Sprint-3/alarmclock/alarmclock.js
@@ -4,12 +4,23 @@ let remainingSeconds = 0;
4
function setAlarm() {
5
let timeRemaining = document.getElementById("timeRemaining");
6
let alarmSet = document.getElementById("alarmSet").value;
7
- remainingSeconds = Number(alarmSet);
+
8
+ remainingSeconds = parseInt(alarmSet);
9
10
if (isNaN(remainingSeconds) || remainingSeconds <= 0) {
- prompt("please enter a value greater than zero!");
11
+ alert("please enter a value greater than zero!");
12
+ return;
13
+ }
14
15
+ if ((remainingSeconds > 86, 400)) {
16
+ alert("Please enter a time less than 24 hourse (86,400)");
17
return;
18
}
19
displayTime();
20
21
+ if (countDown) {
22
+ clearInterval(countDown);
23
24
countDown = setInterval(timer, 1000);
25
26
0 commit comments