Skip to content

Manchester | ITP-Jan-26 | Ofonime Edak| Sprint 2 |Structuring and testing Data#1097

Open
Ofonimeedak wants to merge 8 commits intoCodeYourFuture:mainfrom
Ofonimeedak:coursework/sprint-2
Open

Manchester | ITP-Jan-26 | Ofonime Edak| Sprint 2 |Structuring and testing Data#1097
Ofonimeedak wants to merge 8 commits intoCodeYourFuture:mainfrom
Ofonimeedak:coursework/sprint-2

Conversation

@Ofonimeedak
Copy link

@Ofonimeedak Ofonimeedak commented Feb 28, 2026

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

I have followed the instructions and responded to the question to the best of my understanding
This PR covers debugging of function errors, testing, and structuring data

@github-actions

This comment has been minimized.

@Ofonimeedak Ofonimeedak added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Feb 28, 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 Feb 28, 2026
@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 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 Feb 28, 2026
@github-actions

This comment has been minimized.

@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 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 Feb 28, 2026
@github-actions

This comment has been minimized.

@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 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 Feb 28, 2026
@Ofonimeedak Ofonimeedak changed the title Manchester | ITP-Jan-26 | Ofonime Edak| Sprint2 |Structuring and testing Data Manchester | ITP-Jan-26 | Ofonime Edak| Sprint 2 |Structuring and testing Data Feb 28, 2026
@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 2026
@cjyuan cjyuan 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 Mar 7, 2026
@cjyuan cjyuan 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 7, 2026
@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 7, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Please note that in CYF courses, the recommended way to inform the reviewer of your changes is to do both of the following:

  • Reply to their feedback.
    • In the responses, clarify how each piece of feedback was addressed to demonstrate that you've carefully reviewed the suggestions.
      • You may find the suggestions in this PR Guide useful.
    • Your response may trigger a notification (depending on the reviewer's settings), helping ensure they’re aware of the updates you’ve made.
  • Replace the "Reviewed" label by a "Needs review" label (which you have done -- great!)
    • Without this label, the reviewer would not know if your changes is ready to be reviewed.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 8, 2026
@Ofonimeedak
Copy link
Author

Thank you very much for your review. I can confirm now that I can spot the bugs after running more test cases. I will commit and resubmit ASAP

@Ofonimeedak
Copy link
Author

Hi CJ, I have made the necessary change in my new commit. Please have a look. Thank you

@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 8, 2026
@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 8, 2026
@Ofonimeedak Ofonimeedak requested a review from cjyuan March 12, 2026 06:39
@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 12, 2026
@Ofonimeedak
Copy link
Author

Added a padStart function to hours between 1 and 9 to ensure output consistency

Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Code is working well. Good job.

Comment on lines +6 to +10
const hours = time.slice(0, 2);
const minutes = time.slice(3, 5);

if (Number(hours) > 12) {
let timeHour = Number(hours) - 12;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not convert hours to a number on line 6 once (instead of repeatedly convert it)?

If you need also hours as a string, you can use a separate variable to store hours as a number.


if (Number(hours) > 12) {
let timeHour = Number(hours) - 12;
if (timeHour.toString().length !== 2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also check timeHour < 10.

if (Number(hours) > 12) {
let timeHour = Number(hours) - 12;
if (timeHour.toString().length !== 2) {
timeHour = timeHour.toString().padStart(2, "0");
Copy link
Contributor

Choose a reason for hiding this comment

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

timeHour was initially declared to stored a converted hour as a number, so it is a best practice not to reuse it to store a different kind of value. A better approach is to introduce a separate variable.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed 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. labels Mar 12, 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. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants