From 4400150cd2d2142ecc747f7721ae217eb3ca1cbb Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 19 Jan 2022 14:54:19 -0500 Subject: LibJS+LibUnicode: Return the appropriate time zone name depending on DST --- .../CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Meta/Lagom/Tools/CodeGenerators') diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp index 3252bf0683..e3bfebfe0b 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp @@ -2207,17 +2207,17 @@ static TimeZoneNames const* find_time_zone_names(StringView locale, StringView t return &s_time_zones[time_zone_index]; } -Optional get_time_zone_name(StringView locale, StringView time_zone, CalendarPatternStyle style) +Optional get_time_zone_name(StringView locale, StringView time_zone, CalendarPatternStyle style, TimeZone::InDST in_dst) { if (auto const* data = find_time_zone_names(locale, time_zone); data != nullptr) { size_t name_index = 0; switch (style) { case CalendarPatternStyle::Short: - name_index = data->short_standard_name; + name_index = (in_dst == TimeZone::InDST::No) ? data->short_standard_name : data->short_daylight_name; break; case CalendarPatternStyle::Long: - name_index = data->long_standard_name; + name_index = (in_dst == TimeZone::InDST::No) ? data->long_standard_name : data->long_daylight_name; break; case CalendarPatternStyle::ShortGeneric: name_index = data->short_generic_name; -- cgit v1.2.3