File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,11 @@ public static TimeZoneValues GetNamesForTimeZone(string timeZoneId, string langu
196
196
throw new ArgumentException ( "Invalid Language Code" , nameof ( languageCode ) ) ;
197
197
}
198
198
199
+ if ( TZConvert . TryWindowsToIana ( timeZoneId , out var ianaId ) )
200
+ {
201
+ timeZoneId = ianaId ;
202
+ }
203
+
199
204
return GetNames ( timeZoneId , langKey , false ) ;
200
205
}
201
206
@@ -212,6 +217,11 @@ public static TimeZoneValues GetAbbreviationsForTimeZone(string timeZoneId, stri
212
217
{
213
218
throw new ArgumentException ( "Invalid Language Code" , nameof ( languageCode ) ) ;
214
219
}
220
+
221
+ if ( TZConvert . TryWindowsToIana ( timeZoneId , out var ianaId ) )
222
+ {
223
+ timeZoneId = ianaId ;
224
+ }
215
225
216
226
return GetNames ( timeZoneId , langKey , true ) ;
217
227
}
@@ -420,11 +430,6 @@ private static string GetCityName(string timeZoneId, string languageKey)
420
430
421
431
private static TimeZoneValues GetNames ( string timeZoneId , string languageKey , bool abbreviations )
422
432
{
423
- if ( TZConvert . KnownWindowsTimeZoneIds . Contains ( timeZoneId , StringComparer . OrdinalIgnoreCase ) )
424
- {
425
- timeZoneId = TZConvert . WindowsToIana ( timeZoneId ) ;
426
- }
427
-
428
433
timeZoneId = GetCldrCanonicalId ( timeZoneId ) ;
429
434
if ( timeZoneId == null )
430
435
{
You can’t perform that action at this time.
0 commit comments