Skip to content

Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement alarmclock - #1412

Open
KhotKeys wants to merge 1 commit into
CodeYourFuture:mainfrom
KhotKeys:sprint-3-alarmclock
Open

Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement alarmclock#1412
KhotKeys wants to merge 1 commit into
CodeYourFuture:mainfrom
KhotKeys:sprint-3-alarmclock

Conversation

@KhotKeys

@KhotKeys KhotKeys commented Aug 8, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

  • Implement alarmclock.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@KhotKeys
KhotKeys force-pushed the sprint-3-alarmclock branch from 39ba3d8 to e929c4a Compare August 8, 2026 17:42
@KhotKeys KhotKeys changed the title Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement alarmclock Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint-3 Aug 8, 2026
@github-actions

This comment has been minimized.

@KhotKeys KhotKeys changed the title Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint-3 Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement alarmclock Aug 8, 2026
@KhotKeys KhotKeys added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected labels Aug 8, 2026
@@ -1,4 +1,24 @@
function setAlarm() {}
function setAlarm() {
let seconds = parseInt(document.getElementById("alarmSet").value, 10);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does parseInt("", 10) give you? Try clicking Set Alarm with the box empty and watch the heading and then think about whether seconds <= 0 on line 16 will ever be true.


heading.innerText = formatTime(seconds);

const timer = setInterval(() => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set a 10 second alarm and then few seconds later set a 30 second one without refreshing. Watch the heading closely. What is happening, and what does const timer being declared inside setAlarm have to do with it?

let seconds = parseInt(document.getElementById("alarmSet").value, 10);
const heading = document.getElementById("timeRemaining");

function formatTime(s) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatTime gets rebuilt every time setAlarm runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants