Skip to content

London | 26-Sep-ITP | Frumentius Tesfay | Sprint 1 | Format clock edge cases - #1634

Open
Frumentius-Rev wants to merge 6 commits into
CodeYourFuture:mainfrom
Frumentius-Rev:format-clock-edge-cases
Open

Frumentius-Rev wants to merge 6 commits into
CodeYourFuture:mainfrom
Frumentius-Rev:format-clock-edge-cases

Conversation

@Frumentius-Rev

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

Changelist

Fixed time conversion for edge cases.
Added tests for different times and conversions.

@Frumentius-Rev Frumentius-Rev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 2, 2026

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.

Could you check whether the expected return values specified in the tests use a consistent format?

When a function's return values are not consistently formatted, it can lead to unintended side effects. For examples:

  1. When the formatted strings are displayed, they may not align nicely:
01:00 am
1:00 pm
12:00 am
01:00 pm
02:00pm
  1. When the formatted strings are compared in a program, they may produce unexpected results:
  • "1:00 pm" < "11:00 pm" evaluates to false
  • "01:00 am" < "11:00 am" evaluates to true

For this reason, it would be better to ensure that the function always returns values in a consistent format.

@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 Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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