Skip to content

London | 26-ITP-May | Eyob Zeray | Sprint 3 | alarmclock - #1316

Open
eyob-tech wants to merge 1 commit into
CodeYourFuture:mainfrom
eyob-tech:feature/alarmclock
Open

London | 26-ITP-May | Eyob Zeray | Sprint 3 | alarmclock#1316
eyob-tech wants to merge 1 commit into
CodeYourFuture:mainfrom
eyob-tech:feature/alarmclock

Conversation

@eyob-tech

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

Implemented setAlarm() in alarmclock.js so the app counts down from a
user-entered number of seconds, displays the remaining time in
#timeRemaining as MM:SS, and calls playAlarm() once it reaches zero.
Along the way, fixed a syntax error (missing backticks around template
literals) that was causing the whole script to fail to load and all 5 tests
to fail. All 5 tests in alarmclock.test.js now pass.

@eyob-tech eyob-tech added 🏕 Priority Mandatory This work is expected 📅 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. Module-Data-Groups The name of the module. labels Jul 27, 2026

@Luro91 Luro91 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The title of the webpage should say Alarm clock app. It says Title here at the moment

Comment on lines +7 to +13
function updateDisplay() {
const minutes = Math.floor(secondsRemaining / 60);
const seconds = secondsRemaining % 60;
const paddedMinutes = String(minutes).padStart(2, "0");
const paddedSeconds = String(seconds).padStart(2, "0");
heading.innerText = `Time Remaining: ${paddedMinutes}:${paddedSeconds}`;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job putting the code for formatting into an own function. This makes it reusable and easier to change the formatting if needed

const input = document.getElementById("alarmSet");
const heading = document.getElementById("timeRemaining");

let secondsRemaining = Number(input.value);

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 happens if the number is 0 or negative?

@@ -1,4 +1,29 @@
function setAlarm() {}
function setAlarm() {

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 happens when a user clicks the set alarm button multiple times?

@Luro91 Luro91 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. 🏕 Priority Mandatory This work is expected Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants