mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
LibJS: Port pad_iso_year() to String
This commit is contained in:
parent
2aa4fcc318
commit
453d3063f5
Notes:
sideshowbarker
2024-07-17 01:11:57 +09:00
Author: https://github.com/linusg
Commit: 453d3063f5
Pull-request: https://github.com/SerenityOS/serenity/pull/17186
Reviewed-by: https://github.com/trflynn89 ✅
5 changed files with 9 additions and 9 deletions
|
@ -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).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue