Skip to content

Conversation

ANCHITAYUSH
Copy link

This PR fixes the issue where the convertUnixToTime function returned lowercase "am" / "pm" instead of uppercase "AM" / "PM".
The test was failing because of case-sensitive string comparison.

  • Before: 01:00 pm
  • After: 01:00 PM

Changes Made
localDateTime.replace(/am|pm/, time => time.toUpperCase());

Fix
Screenshot 2025-08-31 011844

ISSUE: issue-52

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2025

CLA assistant check
All committers have signed the CLA.

@ANCHITAYUSH
Copy link
Author

Issue : issue-242

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

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

The test passes on an en-US locale. The correct fix won't involve a regex to the application code, but making the test mock the locale.

@ANCHITAYUSH
Copy link
Author

I’ve updated the test to mock the locale so that toLocaleTimeString consistently returns results in en-US format with uppercase AM/PM. This ensures the test passes deterministically across environments without modifying the application logic.

@coveralls
Copy link

Coverage Status

coverage: 74.359%. remained the same
when pulling b31b5ea on ANCHITAYUSH:hotfix
into 8b3f045 on OneBusAway:main.

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.

5 participants