Glasgow | 26-ITP-May | Niangh Ciang | Sprint 3 | Alarm Clock - #1273
Glasgow | 26-ITP-May | Niangh Ciang | Sprint 3 | Alarm Clock#1273Niangh-Ciang wants to merge 4 commits into
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start, but there are a couple of things you need to check again
| @@ -1,4 +1,23 @@ | |||
| function setAlarm() {} | |||
| function setAlarm() { | |||
There was a problem hiding this comment.
Have you properly handled input validation?
There was a problem hiding this comment.
I’ve added input validation so the alarm will show a message when no time is set or when the time is zero or negative.
| const timeRemainingDisplay = document.getElementById("timeRemaining"); | ||
|
|
||
| timeRemainingDisplay.innerText = `Time Remaining: ${formatTime(remainingTime)}`; | ||
| const countdownInterval = setInterval(() => { |
There was a problem hiding this comment.
What happens if there is already an alarm countdown happening and you start another one?
There was a problem hiding this comment.
If a countdown is already running and I start a new one, the old countdown doesn’t stop. This makes the timer behave incorrectly sometimes it goes faster or skips numbers because two countdowns are running at the same time.
LonMcGregor
left a comment
There was a problem hiding this comment.
Great, the alarm clock is working well now
Self checklist
Changelist
Completed full implementation in alarmclock.js.