fix(offset): accept "ut" / "UT" as a bare UTC timezone abbreviation#287
Open
0xSoftBoi wants to merge 2 commits into
Open
fix(offset): accept "ut" / "UT" as a bare UTC timezone abbreviation#2870xSoftBoi wants to merge 2 commits into
0xSoftBoi wants to merge 2 commits into
Conversation
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #287 +/- ##
=======================================
Coverage 99.30% 99.30%
=======================================
Files 20 20
Lines 3894 3903 +9
Branches 122 122
=======================================
+ Hits 3867 3876 +9
Misses 26 26
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
please run cargo fmt |
|
Review bump on this one too. The change itself is intentionally small and the tests/coverage are in place; the visible follow-ups are the formatting failure and the CodSpeed warning. If the approach looks acceptable from a maintainer standpoint, I can clean up the remaining CI nit quickly. |
GNU date -d accepts "ut" and "UT" (Universal Time) as synonyms for UTC.
parse_datetime rejected them because the timezone_name_to_offset table
contained "utc" and "gmt" but was missing "ut".
Add "ut" => "+0" to the lookup table. "gmt" was already present and
continues to work unchanged.
Add regression tests:
- offset-level: timezone_name_without_offset now includes "ut"
- lib-level: test_bare_utc_timezone_abbreviations covers all four
forms (ut, UT, gmt, GMT) end-to-end
Fixes uutils#280
a430ba2 to
e21fcf2
Compare
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.
Summary
Root cause
`timezone_name_to_offset` in `offset.rs` contained `"utc"` and `"gmt"` but was missing `"ut"`. Since the parser lowercases the input before matching, `UT` was also affected.
Changes
Test Plan
Fixes #280