mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 00:27:47 +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
|
@ -209,7 +209,7 @@ ThrowCompletionOr<DeprecatedString> temporal_year_month_to_string(VM& vm, PlainY
|
|||
// 3. Let year be ! PadISOYear(yearMonth.[[ISOYear]]).
|
||||
// 4. Let month be ToZeroPaddedDecimalString(yearMonth.[[ISOMonth]], 2).
|
||||
// 5. Let result be the string-concatenation of year, the code unit 0x002D (HYPHEN-MINUS), and month.
|
||||
auto result = DeprecatedString::formatted("{}-{:02}", pad_iso_year(year_month.iso_year()), year_month.iso_month());
|
||||
auto result = DeprecatedString::formatted("{}-{:02}", MUST_OR_THROW_OOM(pad_iso_year(vm, year_month.iso_year())), year_month.iso_month());
|
||||
|
||||
// 6. Let calendarID be ? ToString(yearMonth.[[Calendar]]).
|
||||
auto calendar_id = TRY(Value(&year_month.calendar()).to_deprecated_string(vm));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue