Skip to content

Conversation

M-Abdoon
Copy link

@M-Abdoon M-Abdoon commented Oct 1, 2025

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

I have completed all the exercises and worked through errors, debugging, implementations, interpretations, and practicing handling time formats.

Copy link

github-actions bot commented Oct 1, 2025

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

2 similar comments
Copy link

github-actions bot commented Oct 1, 2025

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

Copy link

github-actions bot commented Oct 1, 2025

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

@M-Abdoon M-Abdoon added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 1, 2025
Copy link

github-actions bot commented Oct 1, 2025

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

1 similar comment
Copy link

github-actions bot commented Oct 1, 2025

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

@M-Abdoon M-Abdoon changed the title Glasgow | 25-ITP-SEP | Mohammed Abdoon | Sprint 2 | coursework/sprint-2 Glasgow | 25-ITP-SEP | Mohammed Abdoon | Sprint 2 | Coursework Oct 3, 2025
Copy link

github-actions bot commented Oct 3, 2025

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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 clean and clear. I just have a few suggestions.

Regarding the PR description, the Self-checklist should be a list of items with checkboxes; you removed the boxes. (Look up "how to represent checked boxes in Markdown")

Comment on lines 20 to 22
let BMI = weight/squaredHeight;
BMI = BMI.toFixed(1);
return Number(BMI);
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you notice the variables squaredHeight and BMI are rendered in different colors?

Many IDEs and viewers that support syntax highlighting (including GitHub) display identifiers in different formats and colors. Can you find out why?

let bmi, camelCase;
let Bmi, PascalCase;
let BMI, UPPER_SNAKE_CASE;

Can you look up the naming conventions in JavaScript? In particular,

  • Variable and function names
  • Class and Types names
  • Named constants

Then, update the variable names according to those conventions.

Comment on lines 32 to 33
// # The Python visualizer stops working when it runs pad because (padStart is not a function), maybe because it uses ES6 version of javascript!
// The return value of pad when it's called for the first time is 00
Copy link
Contributor

Choose a reason for hiding this comment

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

A common convention for indicating that a value is a string is to enclose it in double quotes. For example, "00".

Comment on lines 39 to 40
currentOutput = formatAs12HourClock("00:37");
targetOutput = "00:37 am";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you look up the 12-hour clock equivalents of the 24-hour times "00:37" and "12:37"?

@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 12, 2025
@M-Abdoon M-Abdoon added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 12, 2025
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.

Changes look good.

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.

Comment on lines 6 to 20
let hours = time.slice(0, 2);
let minutes= time.slice(3, 5);
let timeIndicator;

if (Number(hours) >= 12) {
hours = String(hours - 12);
hours = hours.padStart(2, "0");
timeIndicator = "pm";
} else {
timeIndicator = "am";
}
return `${time} am`;
if ( hours === "00")
hours = "12";

return `${hours}:${minutes} ${timeIndicator}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

On lines 10-11: Mixing numbers and strings can be dangerous.

A better approach could be:

  1. Convert hours to a number once at the beginning
  2. Carry out calculation using only numbers in the function body (no type conversion needed)
  3. At line 20, call .padStart() once to format hours as a 2-digit string.

@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 Oct 13, 2025
@M-Abdoon
Copy link
Author

Changes look good.

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.

Ok, I do that for the next PL reviews, thank you so much.

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