Closed takla21 closed 1 year ago
Tagging subscribers to this area: @dotnet/area-system-datetime See info in area-owners.md if you want to be subscribed.
Author: | takla21 |
---|---|
Assignees: | - |
Labels: | `area-System.DateTime` |
Milestone: | - |
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
Author: | takla21 |
---|---|
Assignees: | - |
Labels: | `os-android`, `untriaged`, `os-ios`, `area-System.DateTime` |
Milestone: | - |
/cc @mdh1418
Any news on it @steveisok @mdh1418 ?
Any news on it @steveisok @mdh1418 ?
Nothing yet, but it is on @mdh1418's list to investigate.
Hi @takla21, I believe the change in behavior is expected. The .NET 6 effort included a unification that affected the base class libraries, so now the Android implementation follows .NET libraries implementation in lieu of the mono/mono BCL implementation that is seen in Classic Xamarin.Android. I believe you might be able to see the abbreviations for the StandardName
and DaylightName
properties if you use GlobalizationMode.Invariant
.
Is there a particular reason you need to have abbreviations for these properties? As the documentation (showing the specific .NET 6 docs) for TimeZoneInfo.StandardName
and TimeZoneInfo.DaylightName
exemplify a full name and do not mention providing abbreviations, I believe any desire to have abbreviations instead in a non GlobalizationMode.Invariant
environment will be an API proposal instead.
Hi @mdh1418, so essentially, we need to display the timezone on our app. In our case, it's easier to fit the abbreviation rather than its full name.
Fortunately, we've worked around it by using another library, https://www.nuget.org/packages/TimeZoneNames, to get the abbreviation. So, if you're saying that it's supposed to behave that way on net6, I guess we can close it. Although, if I recall correctly, on iOS, it still displays the timezone as abbreviated. Does this mean that there should be a bug on iOS instead?
It might indeed be a bug on iOS as we use our own version of ICU to grab information, so the appropriate data to get the full name for StandardName and DaylightName might have been filtered out. I'll have to investigate that. Thanks for pointing it out!
Closing this issue as it is the current expected behavior for Android, will create an iOS issue after confirming the bug.
Description
Since
net6.0-android
,StandardName
&DaylightName
does not return abbreviations. Instead it returns the full name.Reproduction Steps
I've made a small uno project containing both a Xamarin version & net6/7 version that checks all
TimeZoneInfo
and displayTimeZoneInfo.Local
info to the page.Alternatively, you could simply add those logs on any net6/7 or xamarin app
Expected behavior
Console logs: logs_expected.txt
Here's the result on my android xamarin sample app provided above
Actual behavior
With the loggin in the expected section, I have this on my android net6/7 project logs_actual.txt
Here's the result on my net6/7 android sample provided above
Regression?
I'm not 100% sure the specific .NET version, but on xamarin it's not an issue.
Known Workarounds
N/A
Configuration
net6.0-android
,net7.0-android
Other information
On
net6.0-ios
, it's still displaying abbreviations forStandardName
&DaylightName
.