LibJS: Remove "era" from Temporal's DateTimeFormat formatting options

This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/0ecf157

The test added here would previously throw:

    TypeError: Unable to determine format for Temporal.PlainDate
This commit is contained in:
Timothy Flynn
2025-11-15 07:59:57 -05:00
committed by Tim Flynn
parent a94335dc5d
commit 15e4deb831
Notes: github-actions[bot] 2025-11-16 13:01:12 +00:00
2 changed files with 9 additions and 2 deletions

View File

@@ -364,8 +364,8 @@ Optional<Unicode::CalendarPattern> get_date_time_format(Unicode::CalendarPattern
// 13. Let anyPresent be false.
auto any_present = false;
// 14. For each property name prop of « "weekday", "year", "month", "day", "era", "dayPeriod", "hour", "minute", "second", "fractionalSecondDigits" », do
static constexpr auto all_fields = AK::Array { Weekday, Year, Month, Day, Era, DayPeriod, Hour, Minute, Second, FractionalSecondDigits };
// 14. For each property name prop of « "weekday", "year", "month", "day", "dayPeriod", "hour", "minute", "second", "fractionalSecondDigits" », do
static constexpr auto all_fields = AK::Array { Weekday, Year, Month, Day, DayPeriod, Hour, Minute, Second, FractionalSecondDigits };
options.for_each_calendar_field_zipped_with(format_options, all_fields, [&](auto const& option, auto&) {
// a. If options.[[<prop>]] is not undefined, set anyPresent to true.