Skip to content

Birmingham | Jan-ITP-2026 | Arunkumar Akilan | Sprint 3 | Alarm Clock#1096

Open
arunkumarakilan wants to merge 3 commits intoCodeYourFuture:mainfrom
arunkumarakilan:alarmclock/sprint3-clean
Open

Birmingham | Jan-ITP-2026 | Arunkumar Akilan | Sprint 3 | Alarm Clock#1096
arunkumarakilan wants to merge 3 commits intoCodeYourFuture:mainfrom
arunkumarakilan:alarmclock/sprint3-clean

Conversation

@arunkumarakilan
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 countdown timer using setInterval
  • Displayed time in MM:SS format
  • Updated UI every second
  • Played alarm sound when timer reaches 00:00
  • Added stop button to pause alarm and timer
  • Fixed Jest configuration and setup for DOM testing
  • Worked on test cases for countdown behaviour

Questions

  • Is my approach to handling time (minutes and seconds calculation) correct?
  • Is there a cleaner way to structure the updateTime function?
  • Any suggestions to improve readability or reduce repetition?

@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 25, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 25, 2026
@github-actions

This comment has been minimized.

@arunkumarakilan arunkumarakilan added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 25, 2026
@jayshreehajgude2012 jayshreehajgude2012 added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 25, 2026
let seconds = input.value%60;
let minutes = (input.value - seconds)/60;
const timeRemaining = document.querySelector("#timeRemaining");
timeRemaining.textContent = `Time Remaining: ${minutes.toString().padStart(2, "0")}:${seconds.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.

Can you helper function or any other technique to improve readability and reusability?

let minutes = (input.value - seconds)/60;
const timeRemaining = document.querySelector("#timeRemaining");
timeRemaining.textContent = `Time Remaining: ${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
givenTime = 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.

can you validate input?

Copy link
Copy Markdown

@jayshreehajgude2012 jayshreehajgude2012 left a comment

Choose a reason for hiding this comment

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

improve readability and apply data validation to improve performance further.

@jayshreehajgude2012 jayshreehajgude2012 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 26, 2026
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. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants