Expose TimeZoneChangedEvent in Maui.Essentials #22615
Unanswered
Mrnikbobjeff
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Detecting when a running Maui app crosses into a new timezone is too complicated. I propose an cross-platform Essential that invokes an event (much like the Connectivity api) that we can handle.
In order to facilitate proper date handling, a new event is added to the Essentials platform that fires whenever the timezone changes on any platform.
A consumer would only see the new event that can be implemented. The handler would give us a place to call TimeZoneInfo.ClearCachedData()
This would close the gap exposed by https://docs.microsoft.com/en-us/dotnet/api/system.timezone.currenttimezone?view=netstandard-2.1#notes-to-callers
"If the system's local time zone subsequently changes, the CurrentTimeZone property does not reflect this change. If you need to handle time zone changes while your application is running, use the TimeZoneInfo class and call its ClearCachedData() method."
(Duplicate issue from Xamarin.Essentials after end of support)
Public API Changes
Beta Was this translation helpful? Give feedback.
All reactions