-
Notifications
You must be signed in to change notification settings - Fork 634
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
fix(datetime): handle am / pm variants #5406
fix(datetime): handle am / pm variants #5406
Conversation
timreichen
commented
Jul 10, 2024
- allows for am / pm variants as described in http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5406 +/- ##
==========================================
- Coverage 96.26% 96.24% -0.02%
==========================================
Files 473 473
Lines 38390 38419 +29
Branches 5571 5584 +13
==========================================
+ Hits 36955 36978 +23
- Misses 1393 1399 +6
Partials 42 42 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my surprise, these tests all pass even without the implementation change. Why? I think we should add more thorough testing for dayPeriod
before working on this addition. Also, we should update the format
and parse
documentation to reflect this change.
I think the problem is in std/datetime/_date_time_formatter.ts Lines 642 to 649 in 3af2ed3
It only checks if |
@babiabeo, would you be interested in creating some tests to compliment this PR? |
@timreichen, reminder that we can't merge this PR until the tests that it touches has been improved. Please see the above comments. |
Please hold with this PR until #5622. |
@timreichen, have the tests been improved as requested above? |
Yes, I added tests for all valid cases and a test that throws on invalid data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM.