-
Notifications
You must be signed in to change notification settings - Fork 567
Fix OpenHarmony's tzdata
parsing
#1679
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1679 +/- ##
==========================================
- Coverage 91.08% 90.67% -0.41%
==========================================
Files 37 39 +2
Lines 17469 17070 -399
==========================================
- Hits 15912 15479 -433
- Misses 1557 1591 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This should come with CI coverage for Android and OpenHarmony. The new parser should be cleaned up, have a look at the rustls style guide (which I wrote) and try to simplify (drop the OS constructor, make the constant names more concise, avoid nested types/functions). |
@djc Hi, all new lines are covered now, and parser was cleaned up. Please take a look. |
OpenHarmony's
tzdata
parsing supported was introduced in #1613.OpenHarmony's
tzdata
shares the same characters with the ones on Android, except that each timezone index is 4 byte's smaller(the legacyrawUtcOffset
was removed).OpenHarmony's tzdata
Android's tzdata
As their parsing logic are pretty similar, I unified their logic into
src/offset/local/tzdata.rs
(I actually created a crate for that, but the logic is simple enough to put into chrono). This also allows us to remove theandroid_tzdata
dependency.BTW, OpenHarmony's tzdata parsing logic was also added in
fallback_timezone
, that's because OpenHarmony doesn't have/etc/localtime
, people need to use it's time service api to get the timezone name. I created a PR for iana-time-zone to support OpenHarmony's timezone name fetching: strawlab/iana-time-zone#150. After getting the timezone name fromiana_time_zone::get_timezone
, chrono need to find it's timezone information in thetzdata
.