1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:27:45 +00:00

LibJS: Port pad_iso_year() to String

This commit is contained in:
Linus Groh 2023-01-26 15:54:09 +00:00
parent 2aa4fcc318
commit 453d3063f5
5 changed files with 9 additions and 9 deletions

View file

@ -191,7 +191,7 @@ ThrowCompletionOr<String> temporal_month_day_to_string(VM& vm, PlainMonthDay& mo
if (show_calendar.is_one_of("always"sv, "critical"sv) || calendar_id != "iso8601"sv) {
// a. Let year be ! PadISOYear(monthDay.[[ISOYear]]).
// b. Set result to the string-concatenation of year, the code unit 0x002D (HYPHEN-MINUS), and result.
result = TRY_OR_THROW_OOM(vm, String::formatted("{}-{}", pad_iso_year(month_day.iso_year()), result));
result = TRY_OR_THROW_OOM(vm, String::formatted("{}-{}", MUST_OR_THROW_OOM(pad_iso_year(vm, month_day.iso_year())), result));
}
// 8. Let calendarString be ! FormatCalendarAnnotation(calendarID, showCalendar).