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

Fix an encoding error with the hour cycle #841

Closed

Conversation

gregtatum
Copy link
Member

I confused the 'H' and 'k' symbols when doing the skeleton work. This is causing issues with implementing #671. There's also an error that can be seen in the French locale where the wrong hour cycle is used.

@gregtatum gregtatum requested review from sffc and zbraniecki as code owners July 1, 2021 16:39
@codecov-commenter
Copy link

Codecov Report

Merging #841 (e365361) into main (67bd340) will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #841      +/-   ##
==========================================
- Coverage   74.80%   74.78%   -0.02%     
==========================================
  Files         198      198              
  Lines       12762    12762              
==========================================
- Hits         9546     9544       -2     
- Misses       3216     3218       +2     
Impacted Files Coverage Δ
components/datetime/src/fields/symbols.rs 67.68% <50.00%> (-0.39%) ⬇️
components/datetime/src/options/components.rs 75.00% <100.00%> (-0.87%) ⬇️
components/datetime/src/pattern/parser.rs 97.02% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67bd340...e365361. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build c1704d9bfea998cf8db3371c90745bfb0c2aa3fa-PR-841

  • 4 of 6 (66.67%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 74.861%

Changes Missing Coverage Covered Lines Changed/Added Lines %
components/datetime/src/fields/symbols.rs 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
components/datetime/src/fields/symbols.rs 1 67.68%
components/datetime/src/options/components.rs 1 75.0%
Totals Coverage Status
Change from base Build 67bd340dd7cb6e1a958ceb36f8f1d4e73c63742e: -0.02%
Covered Lines: 9672
Relevant Lines: 12920

💛 - Coveralls

Comment on lines 148 to +151
Hour::H11 => 'K',
Hour::H12 => 'h',
Hour::H23 => 'H',
Hour::H24 => 'k',
Hour::H23 => 'k',
Hour::H24 => 'H',
Copy link
Member

Choose a reason for hiding this comment

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

Reviewing: According to UTS 35:

https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table

h = Hour [1-12] = h12
H = Hour [0-23] = h23
K = Hour [0-11] = h11
k = Hour [1-24] = h24
j = locale preference
J = locale preference, omit day period

So, wasn't it correct before this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I screwed this up in this PR. I got confused that h12 and h23 are what are stored in skeletons, and then misread the symbol information. Thanks for double checking this. I'll try and sort it out in my other PR.

Copy link
Member Author

@gregtatum gregtatum Jul 2, 2021

Choose a reason for hiding this comment

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

The h H being h12 and h23, and then K being h11 and k being h24 is inconsistent in what symbols match that my brain refuses to parse things correctly.

@gregtatum gregtatum closed this Jul 2, 2021
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