-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Calendar selected in device settings not available in CultureInfo #109924
Comments
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
Not relevant to the issue that is reported |
@ashrivax23 Can you try running this code inside an .NET iOS ( https://github.com/ashrivax23/DateTimeFormatMauiSample/blob/main/MainPage.xaml.cs#L60-L106 I can't speak for Android (@jonathanpeppers would you know where to look for that?), but for iOS you're most likely facing what this user did: https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/localization/
https://github.com/ashrivax23/DateTimeFormatMauiSample/blob/main/Platforms/iOS/Info.plist These docs are for Xamarin.iOS, but also apply to MAUI iOS and Catalyst. |
I can repro this issue at iOS & Android platform on the latest 17.12 Preview 5(9.0.0-rc.1.24453.9 & 9.0.0-rc.2.24503.2). |
I tried the above mentioned approach. Created this application: https://github.com/ashrivax23/DateTimeIOSSample In the above application I can see the calendar change in the date picker. Please check the attached screenshots of the simulator with the locale, date format and calendar shown in the UI |
Tagging subscribers to this area: @dotnet/area-system-globalization |
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger |
CC @matouskozak |
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger |
Description
<style> </style>We are building a MAUI app with .NET 9 for iOS and Android and saw an issue in iOS and some Android device e.g. Samsung Galaxy Note 20 in which if the calendar is changed in the setting the CultureInfo doesn’t have the updated calendar information. Details are below along with a sample application.
Below is the table that shows what date format is shown in the app when we set language, region and calendar (when available) on an iOS and Android devices
For iOS we can see option to select Gregorian, Japanese or Buddhist calendar from the device settings.
For Android on Samsung Note 20 we can see calendars like Chinese Lunar, Hijri, Korean Lunar, Shamsi etc. Not all Android devices have the ability to change the calendar.
Steps to Reproduce
Attached is a sample application that will show the dates and locale information.
Steps
Link to public reproduction project repository
https://github.com/ashrivax23/DateTimeFormatMauiSample
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
No response
Did you find any workaround?
For iOS I could write a method using NSCalendar to find which calendar is set on the device setting and based on that set the calendar in the app but that has other issues like characters from other language show with the date e.g. Thai characters shown when language is English and calendar is Buddhist.
For Android found no work arounds.
Relevant log output
The text was updated successfully, but these errors were encountered: