Fix toLocaleString timeZoneName returning full name instead of abbreviation#2330
Conversation
Co-authored-by: lahma <171892+lahma@users.noreply.github.com>
|
@copilot check windows ci failure |
…up table Co-authored-by: lahma <171892+lahma@users.noreply.github.com>
The Windows CI failure was in Fixed in a13db30 by adding Windows timezone ID aliases directly to the |
toLocaleStringwithtimeZoneName: 'short'was returning the full .NET timezone name (e.g.,"Eastern Standard Time") instead of the proper IANA abbreviation ("EST"/"EDT"). The same issue affectedtimeStyle: 'full'/'long'andtimeZoneName: 'long', which always returned the standard name regardless of DST.Root Cause
GetTimeZoneDisplayNameinJsDateTimeFormathad a broken fallback for the no-explicit-timezone case:Three bugs in one line:
TimeZoneInfo.Localinstead of the engine's configured default timezoneStandardNameeven during daylight saving time"Eastern Standard Time"), not an abbreviationFix
Replaced the fallback with proper logic mirroring the explicit-timezone path:
Result:
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.