[WASM] Use consistent display names for UTC time zone#50650
[WASM] Use consistent display names for UTC time zone#50650tarekgh merged 1 commit intodotnet:mainfrom
Conversation
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsResolves #50305 For wasm, the The So, with this change, Aliases of UTC will retain their requested IDs, such as This affects the browser target only. Some minor refactoring was done for consistency of the code, but results in no behavioral changes or visible changes in the output strings of other targets.
|
Resolves #50305
For wasm, the
StandardNameandDaylightNameproperties of the UTC time zone and all aliases of UTC will simply be"UTC".The
DisplayNameproperty for UTC and its aliases will follow the same rules as all other display names in wasm in that they use the offset followed by the ID, except that we will also honor the convention from all other targets where the offset string for UTC is"(UTC)"rather than"(UTC+00:00)"(This convention is carried over from the established convention in the Windows OS time zone data, as it helps prevent users from picking a different time zone like London that has DST.)So, with this change,
TimeZoneInfo.Utc.DisplayNameis"(UTC) UTC", which may seem redundant in isolation but aligns well with the format used by other time zones such as"(UTC-08:00) America/Los_Angeles"- so works well in a list.Aliases of UTC will retain their requested IDs, such as
TimeZoneInfo.FindSystemTimeZoneById("Etc/UTC").DisplayNamewhich will now be"(UTC) Etc/UTC".This affects the browser target only. Some minor refactoring was done for consistency of the code, but results in no behavioral changes or visible changes in the output strings of other targets.
@eerhardt @tarekgh @lewing