mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibJS: Implement the Extend TimeZoneName Option Proposal
This is a stage 4 proposal that was recently merged into the main ECMA-402 spec. See: https://github.com/tc39/ecma402/commit/1ba5ee7
This commit is contained in:
committed by
Linus Groh
parent
126a3fe180
commit
022b416570
Notes:
sideshowbarker
2024-07-17 21:45:56 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/022b4165702 Pull-request: https://github.com/SerenityOS/serenity/pull/11575 Reviewed-by: https://github.com/linusg ✅
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
|
||||
* Copyright (c) 2021-2022, Tim Flynn <trflynn89@pm.me>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
@@ -216,7 +216,7 @@ ThrowCompletionOr<void> for_each_calendar_field(GlobalObject& global_object, Uni
|
||||
constexpr auto narrow_short_long = AK::Array { "narrow"sv, "short"sv, "long"sv };
|
||||
constexpr auto two_digit_numeric = AK::Array { "2-digit"sv, "numeric"sv };
|
||||
constexpr auto two_digit_numeric_narrow_short_long = AK::Array { "2-digit"sv, "numeric"sv, "narrow"sv, "short"sv, "long"sv };
|
||||
constexpr auto short_long = AK::Array { "short"sv, "long"sv };
|
||||
constexpr auto time_zone = AK::Array { "short"sv, "long"sv, "shortOffset"sv, "longOffset"sv, "shortGeneric"sv, "longGeneric"sv };
|
||||
|
||||
// Table 4: Components of date and time formats, https://tc39.es/ecma402/#table-datetimeformat-components
|
||||
TRY(callback(pattern.weekday, vm.names.weekday, narrow_short_long));
|
||||
@@ -229,7 +229,7 @@ ThrowCompletionOr<void> for_each_calendar_field(GlobalObject& global_object, Uni
|
||||
TRY(callback(pattern.minute, vm.names.minute, two_digit_numeric));
|
||||
TRY(callback(pattern.second, vm.names.second, two_digit_numeric));
|
||||
TRY(callback(pattern.fractional_second_digits, vm.names.fractionalSecondDigits, Empty {}));
|
||||
TRY(callback(pattern.time_zone_name, vm.names.timeZoneName, short_long));
|
||||
TRY(callback(pattern.time_zone_name, vm.names.timeZoneName, time_zone));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user