-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
date: add locale-aware calendar support for era years #10473
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
Conversation
16a4b2d to
1684817
Compare
|
GNU testsuite comparison: |
1684817 to
c3a75e5
Compare
|
GNU testsuite comparison: |
Implements era year calculation for Buddhist, Persian Solar Hijri, and Ethiopian calendars based on locale detection. The %Y format specifier now outputs era-appropriate years while maintaining Gregorian calendar for ISO-8601 and RFC-3339 formats for interoperability.
c3a75e5 to
f7edb96
Compare
|
GNU testsuite comparison: |
| /// # Returns | ||
| /// * `Some((era_year, month, day))` - Date in target calendar system | ||
| /// * `None` - If conversion fails | ||
| pub fn convert_date_to_locale_calendar( |
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.
So this function isn't really correct since the days in a month is different in these calendars, it can give you the correct result for years, but this is still one of those examples where it would be better to directly use Jiff ICU instead of doing this conversion ourselves.
|
On a high level just the same feedback from the previous PR for the date utility, I think this is the right high level approach to take, but that we should use the jiff-icu library for doing the final conversions since there's a bunch of edge cases here. But this is something that doesn't need to be done with this PR. The main benefit I see here is adding the ICU-locale library and adding the logic for detecting which calendar to use which we can build off in future PR's. |
|
@ChrisDryden do you want to do the next steps ? or should i ? thanks |
|
Mind if I make an example right now of what I was thinking for one of them using jiff-icu and then we can see if we're aligned? |
|
au contraire :) |
built on top of
#10457