Skip to content

London | 26-ITP-Sep | Mandip Sanger | Sprint 1 | formatAs12HourClock - #1767

Open
mandipsanger wants to merge 1 commit into
CodeYourFuture:mainfrom
mandipsanger:format-edge-cases
Open

mandipsanger wants to merge 1 commit into
CodeYourFuture:mainfrom
mandipsanger:format-edge-cases

Conversation

@mandipsanger

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-1197

Replace this line with the Task code (e.g. CYF-0000).

Changelist

format clock edge cases

Briefly explain your PR.

Edgecase

@github-actions

This comment has been minimized.

@mandipsanger mandipsanger added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 31, 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 Oct 31, 2026
@mandipsanger mandipsanger added NotCoursework Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 31, 2026
@Poonam-raj Poonam-raj 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 3, 2026
const minutes = time.slice(3);

const hours = Number(time.slice(0, 2));
const period = hours >= 12 ? "pm" : "am";

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.

Good use of the ternary operator!

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.

Great test cases, good edge case work here. As a stretch - how could "bad" behaviours be tested here? What could go wrong with this function? How could we test that?

@Poonam-raj Poonam-raj 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.

Great work, some nice logic going in. I've left a stretch comment around how we check for things that can go wrong in a function. Have a think.

@Poonam-raj Poonam-raj 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 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. NotCoursework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants