Repository navigation
Don't truncate "uu" extended years to two digits - #1539
Open
YouKnowChatta wants to merge 1 commit into
Open
YouKnowChatta wants to merge 1 commit into
YouKnowChatta wants to merge 1 commit into
Conversation
UTS python-babel#35 gives two-letter truncation to "yy" and "YY" only. For "u" every field length is a minimum number of digits, so "uu" formats 2024 as 2024 and year 5 as 05.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DateTimeFormat.format_year()keeps only the last two digits of any two-letter year field. UTS #35 asks for that withyyandYY, but not withu. The Date Field Symbol Table says: "For 'u', all field lengths specify a minimum number of digits; there is no special interpretation for "uu"."ICU 78.3's
SimpleDateFormat, called through PyICU, formatsuuas2024for that date and as05for year 5. This change skips the truncation foru, souuis a two-digit minimum width, andyyandYYstill truncate. No date, time, datetime, skeleton, or interval pattern in the CLDR 49 data usesu, so the locales' own formats don't change.The new test in
tests/test_date_time_format.pyfails before the change and passes after it. With CLDR 49 data on Python 3.15,python -X utf8 -m pytestreports 8294 passed, 3 skipped, and 2 xfailed, and the pre-commit hooks pass on both changed files.