From 453d3063f5b484d46dd6e704b296bb6191ad8f13 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 26 Jan 2023 15:54:09 +0000 Subject: LibJS: Port pad_iso_year() to String --- Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp') diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp index c6d26368a4..bf713800ed 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp @@ -264,7 +264,7 @@ ThrowCompletionOr temporal_date_time_to_string(VM& vm, i32 iso auto calendar_string = TRY(maybe_format_calendar_annotation(vm, calendar, show_calendar)); // 9. Return the string-concatenation of year, the code unit 0x002D (HYPHEN-MINUS), month, the code unit 0x002D (HYPHEN-MINUS), day, 0x0054 (LATIN CAPITAL LETTER T), hour, the code unit 0x003A (COLON), minute, seconds, and calendarString. - return DeprecatedString::formatted("{}-{:02}-{:02}T{:02}:{:02}{}{}", pad_iso_year(iso_year), iso_month, iso_day, hour, minute, seconds, calendar_string); + return DeprecatedString::formatted("{}-{:02}-{:02}T{:02}:{:02}{}{}", MUST_OR_THROW_OOM(pad_iso_year(vm, iso_year)), iso_month, iso_day, hour, minute, seconds, calendar_string); } // 5.5.7 CompareISODateTime ( y1, mon1, d1, h1, min1, s1, ms1, mus1, ns1, y2, mon2, d2, h2, min2, s2, ms2, mus2, ns2 ), https://tc39.es/proposal-temporal/#sec-temporal-compareisodatetime -- cgit v1.2.3