Skip to content

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 3 | my alarm app - #1329

Open
meneogbemi42-bit wants to merge 4 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:sprint-3/-alarmclockapp
Open

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 3 | my alarm app#1329
meneogbemi42-bit wants to merge 4 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:sprint-3/-alarmclockapp

Conversation

@meneogbemi42-bit

Copy link
Copy Markdown

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

This PR implements the previously-empty setAlarm function for the Sprint-3 alarm clock. It adds a countdown timer (with input validation, formatted MM:SS display, interval management) and plays alarmsound.mp3 when the timer reaches zero.

@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 28, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Just one minor issue.

Comment on lines +10 to +12
if (countdownInterval) {
clearInterval(countdownInterval);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What other application states should also be reset before starting a new countdown?

Note: a user may not click the "Stop" button first before starting a new count down.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i added the paulse Alarm right after validating the input because If the previous alarm reached zero and audio was currently playing, setting a brand-new timer without clicking the Stop button first would leave the old audio playing in the background while the new countdown started. This stops any active sound immediately. and secondly i (input.value = "") after starting the timer. This cleans up the user interface so the input box doesn't stay pre-filled with old numbers while the countdown is actively running. i don't know if this meet what you mean in the question you asked.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes. I was referring to the alarm. Clearing the input field is also a good idea.

Well done!

@cjyuan cjyuan 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 Aug 3, 2026
@meneogbemi42-bit meneogbemi42-bit added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 3, 2026
@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 🏕 Priority Mandatory This work is expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants