Skip to content

London | 26-ITP-May |Maharit Belai | Sprint 3| Alarmclock - #1554

Open
MaharitB wants to merge 4 commits into
CodeYourFuture:mainfrom
MaharitB:alarmclock
Open

MaharitB wants to merge 4 commits into
CodeYourFuture:mainfrom
MaharitB:alarmclock

Conversation

@MaharitB

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

Task code

CYF-1098

Changelist

I have met all the criteria.

Questions

@MaharitB MaharitB added Reviewed Volunteer to add when completing a review with trainee action still to take. 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 Nov 20, 2026
Comment on lines +19 to +20
"jest": "^30.5.2",
"jest-environment-jsdom": "^30.5.2"

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 Jest packages are pinned with ^30.5.2, a version range that does not match a published Jest release. Installing these dependencies will fail; could you verify the versions before adding them?

To "like" or "dislike" this comment, please follow this link

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
.toString()
.padStart(2, "0")}:${(inputTime.value % 60).toString().padStart(2, "0")}`;

const toStop = setInterval(alarmCount, 1000);

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 to the active countdown if Set Alarm is clicked again before it finishes?

To "like" or "dislike" this comment, please follow this link

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
const toStop = setInterval(alarmCount, 1000);

function alarmCount() {
if (inputTime.value == 0) {

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 this condition do when Set Alarm is clicked with the number field left empty?

To "like" or "dislike" this comment, please follow this link

@cyf-ai-code-reviewer cyf-ai-code-reviewer Bot 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 Nov 20, 2026
@cyf-ai-code-reviewer

Copy link
Copy Markdown

The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look.

@MaharitB MaharitB 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 Nov 20, 2026
@hackertainment hackertainment 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 Nov 27, 2026

@hackertainment hackertainment 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 logic is very clear and easy to understand. The code also looks clean and good to me. Proper use of helper functions. Well done and please keep it up. Congratulation, you have completed this PR successfully. Thank you.

Comment on lines +3 to +4
const inputTime = document.querySelector("#alarmSet");
const timeRemaining = document.querySelector("#timeRemaining");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It might be worth to consider using .getElementById(" instead of .querySelector("# for clarity in the future.

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.

Thank you for your suggestion i will consider it next time!

Comment on lines +6 to +10
timeRemaining.textContent = `Time Remaining: ${Math.floor(
inputTime.value / 60
)
.toString()
.padStart(2, "0")}:${(inputTime.value % 60).toString().padStart(2, "0")}`;

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 correct, but the indentation might make it a bit hard to read.

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.

You are right but I am afraid it is prettier :).

Comment on lines +12 to +14
if (toStop !== null) return;

toStop = setInterval(alarmCount, 1000);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A better logic could be:

  if (toStop == null) {
    toStop = setInterval(alarmCount, 1000);
  }

@hackertainment hackertainment added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 27, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants