Skip to content

Fix noon/midnight time display by deriving from numeric time values#123

Draft
jsit with Copilot wants to merge 4 commits into
developfrom
copilot/fix-schedule-page-time-format
Draft

Fix noon/midnight time display by deriving from numeric time values#123
jsit with Copilot wants to merge 4 commits into
developfrom
copilot/fix-schedule-page-time-format

Conversation

Copilot AI commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

The schedule page displays times using "12:00n" for noon and "12:00m" for midnight—a non-standard convention. These should use standard AM/PM format.

Changes

  • ScheduleService.formatTime(): Updated to derive time display from the <time> XML element (minutes after midnight) instead of using <time_str>. Converts numeric values to 12-hour formatted strings (e.g., 0 → "12:00am", 720 → "12:00pm")

    formatTime(minutes: number): string {
      const hours = Math.floor(minutes / 60);
      const mins = minutes % 60;
      
      let displayHour = hours % 12;
      if (displayHour === 0) {
        displayHour = 12;
      }
      
      const ampm = hours < 12 ? 'am' : 'pm';
      const minuteStr = mins === 0 ? '00' : mins.toString().padStart(2, '0');
      
      return `${displayHour}:${minuteStr}${ampm}`;
    }
  • SchedulePage: Updated to pass show.time (numeric) instead of show.time_str to formatTime()

  • Tests: Added comprehensive unit tests for formatTime() with numeric inputs and integration tests verifying display in SchedulePage

  • Mock data: Added noon/midnight show examples for test coverage

[!WARNING]

Original prompt

This section details on the original issue you should resolve

<filter_complete></filter_complete>

<issue_title>"12:00m" and "12:00n" should be "12:00am" and "12:00pm"</issue_title>
<issue_description>Currently on the Schedule Page, noon is represented as "12:00n" and midnight as "12:00m," a convention I've never seen before.

Instead, these should be printed as "12:00pm" and "12:00am".</issue_description>

Comments on the Issue (you are @copilot in this section)

Original prompt

This section details on the original issue you should resolve

<issue_title>"12:00m" and "12:00n" should be "12:00am" and "12:00pm"</issue_title>
<issue_description>Currently on the Schedule Page, noon is represented as "12:00n" and midnight as "12:00m," a convention I've never seen before.

Instead, these should be printed as "12:00pm" and "12:00am".</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 18, 2025 13:26
Co-authored-by: jsit <643417+jsit@users.noreply.github.com>
Co-authored-by: jsit <643417+jsit@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix time format on schedule page to use am/pm Fix noon/midnight time display: 12:00n/12:00m → 12:00pm/12:00am Nov 18, 2025
Copilot AI requested a review from jsit November 18, 2025 13:31

@jsit jsit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What the ScheduleService should probably do is derive the time display from the <time> XML element (which represents minutes after midnight) to generate the time string, rather than using <time_str> at all.

@jsit

jsit commented Nov 18, 2025

Copy link
Copy Markdown
Member

@copilot Address my feedback please.

@jsit

jsit commented Nov 18, 2025

Copy link
Copy Markdown
Member

@copilot Address my feedback please.

@jsit

jsit commented Nov 18, 2025

Copy link
Copy Markdown
Member

@copilot Address my feedback please

Co-authored-by: jsit <643417+jsit@users.noreply.github.com>

Copilot AI commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Address my feedback please

Done. Updated formatTime() to derive the time display from the <time> XML element (minutes after midnight) instead of using <time_str>. The method now converts numeric values like 0 → "12:00am" and 720 → "12:00pm". (commit: 96acf61)

Copilot AI changed the title Fix noon/midnight time display: 12:00n/12:00m → 12:00pm/12:00am Fix noon/midnight time display by deriving from numeric time values Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"12:00m" and "12:00n" should be "12:00am" and "12:00pm"

2 participants