@@ -48,6 +48,26 @@ private static string GetUtcFullDisplayName(string timeZoneId, string standardDi
48
48
}
49
49
#pragma warning restore IDE0060
50
50
51
+ private static void GetStandardDisplayName ( string timeZoneId , ref string ? displayName )
52
+ {
53
+ // Determine the culture to use
54
+ CultureInfo uiCulture = CultureInfo . CurrentUICulture ;
55
+ if ( uiCulture . Name . Length == 0 )
56
+ uiCulture = CultureInfo . GetCultureInfo ( FallbackCultureName ) ; // ICU doesn't work nicely with InvariantCulture
57
+
58
+ GetDisplayName ( timeZoneId , Interop . Globalization . TimeZoneDisplayNameType . Standard , uiCulture . Name , ref displayName ) ;
59
+ }
60
+
61
+ private static void GetDaylightDisplayName ( string timeZoneId , ref string ? displayName )
62
+ {
63
+ // Determine the culture to use
64
+ CultureInfo uiCulture = CultureInfo . CurrentUICulture ;
65
+ if ( uiCulture . Name . Length == 0 )
66
+ uiCulture = CultureInfo . GetCultureInfo ( FallbackCultureName ) ; // ICU doesn't work nicely with InvariantCulture
67
+
68
+ GetDisplayName ( timeZoneId , Interop . Globalization . TimeZoneDisplayNameType . DaylightSavings , uiCulture . Name , ref displayName ) ;
69
+ }
70
+
51
71
// Helper function that retrieves various forms of time zone display names from ICU
52
72
private static unsafe void GetDisplayName ( string timeZoneId , Interop . Globalization . TimeZoneDisplayNameType nameType , string uiCulture , ref string ? displayName )
53
73
{
@@ -96,8 +116,13 @@ private static unsafe void GetDisplayName(string timeZoneId, Interop.Globalizati
96
116
}
97
117
98
118
// Helper function that builds the value backing the DisplayName field from globalization data.
99
- private static void GetFullValueForDisplayNameField ( string timeZoneId , TimeSpan baseUtcOffset , CultureInfo uiCulture , ref string ? displayName )
119
+ private static void GetFullValueForDisplayNameField ( string timeZoneId , TimeSpan baseUtcOffset , ref string ? displayName )
100
120
{
121
+ // Determine the culture to use
122
+ CultureInfo uiCulture = CultureInfo . CurrentUICulture ;
123
+ if ( uiCulture . Name . Length == 0 )
124
+ uiCulture = CultureInfo . GetCultureInfo ( FallbackCultureName ) ; // ICU doesn't work nicely with InvariantCulture
125
+
101
126
// There are a few diffent ways we might show the display name depending on the data.
102
127
// The algorithm used below should avoid duplicating the same words while still achieving the
103
128
// goal of providing a unique, discoverable, and intuitive name.
0 commit comments