Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat en locale time formatting to fix issue for 12:00 AM formatting #44

Closed
wants to merge 1 commit into from

Conversation

rokane
Copy link

@rokane rokane commented Jan 13, 2024

Description:

This issue addresses a bug which was raised in #41 . Please see the issue comments for further understanding of the conversation around this issue.

TLDR:
According to the CLDR specification the 'en' locale should be formatting the value for 12:00 AM as 12:00 AM and not 00:00 AM

Changes:

  • FmtTimeShort, FmtTimeMedium, FmtTimeLong and FmtTimeFull now displaying 12 for representing the hour 12:00 AM
  • Unit tests added for each of the functions to cover this case.

Excluded:

In addition to this, I discovered the same issue exists for a large number of the en locales, any locale which should be formatting hours as the patter h as defined by the CLDR spec. I excluded these, due to a large number of unit tests being commented out for those locales. Given I am not aware of the context as to why they are commented out, I didn't want to touch those.

I have created a follow up issue to address this: #45

fixes #41

* FmtTimeShort, FmtTimeMedium, FmtTimeLong and FmtTimeFull all formatted hours using 24 hour time
* Fix reformats hour to adhere to 12 hour format and align with CLDR spec
@rokane
Copy link
Author

rokane commented Jan 13, 2024

@deankarn I had a go at fixing this issue.
Can you please take a look and let me know what you think?

@rokane rokane closed this Jan 27, 2024
@rokane rokane deleted the bug/en-time-formatting branch January 27, 2024 21:01
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 hour time bug
1 participant