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

Correct alternate calendar handling #109

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

drewhamilton
Copy link
Collaborator

@drewhamilton drewhamilton commented Mar 3, 2023

Expands LocalesTest to test a non-Gregorian calendar (Saudi Arabia uses an Islamic calendar) and to test with multiple device default locale calendars.

The latter uncovered that we were converting from java.time types to Calendar incorrectly, so I've fixed that bug. My understanding here was not correct: Rather than converting ISO-8601 java.time types to a locale-specific Calendar instance, we want to convert them to an ISO-8601 Calendar instance, because that is what they represent. The device locale (or consumer-passed locale) should only be used during formatting: This is what the ChronoLocalDate docs mean when they say "This approach treats the problem of globalized calendar systems as a localization issue and confines it to the UI layer."

Closes #107.

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.

Test date/time formatting in different locales
3 participants