Skip to content

London | May-26 | Liridona Shehu | Sprint 3 | Module-Data-Groups - Alarmclock - #1309

Open
shehu-dona wants to merge 2 commits into
CodeYourFuture:mainfrom
shehu-dona:Sprint-3/ALARMCLOCK
Open

London | May-26 | Liridona Shehu | Sprint 3 | Module-Data-Groups - Alarmclock#1309
shehu-dona wants to merge 2 commits into
CodeYourFuture:mainfrom
shehu-dona:Sprint-3/ALARMCLOCK

Conversation

@shehu-dona

Copy link
Copy Markdown

Self checklist

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

Changelist

A PR with a alarm app

@github-actions

This comment has been minimized.

@shehu-dona shehu-dona changed the title London | May-26 | Liridona Shehu | Sprint 3 | Module-Data-Groups | Alarmclock London | May-26 | Liridona Shehu | Sprint 3 | Module-Data-Groups - Alarmclock Jul 27, 2026
@shehu-dona shehu-dona 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. Module-Data-Groups The name of the module. labels Jul 27, 2026
Comment on lines +20 to +26
let currentMinutes = Math.floor(remainingSeconds / 60)
.toString()
.padStart(2, "0");
let currentSeconds = Math.floor(remainingSeconds % 60)
.toString()
.padStart(2, "0");
timeRemainingHeading.innerText = `Time Remaining: ${currentMinutes}:${currentSeconds}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This code is duplicated from line 9 to 16. How can you remove the duplication? (Duplicated code makes maintenance harder as you would have make changes in multiple places. Imagine the formatting should change for example)

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.

Created a function formatTime() and call it when i need it.

clearInterval(intervalId);

const initialSeconds = Number(document.getElementById("alarmSet").value);
remainingSeconds = initialSeconds;

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 I start the alarm with 0 seconds or a negative value?

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.

Checked for 0, negative or empty input.

@Luro91 Luro91 added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 30, 2026
@shehu-dona shehu-dona added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label 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. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants