mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
LibJS: Update spec comments to use ToZeroPaddedDecimalString AO
This is an editorial change in the ECMA-262 and Temporal specs. See: -843d8b8
-f9211d9
Note that we don't actually need to implement the AO as we already have String::formatted() for this, and use unified format strings instead of zero-padding in individual steps in many cases anyway.
This commit is contained in:
parent
431a9938a8
commit
5397278bfc
10 changed files with 41 additions and 45 deletions
|
@ -723,6 +723,8 @@ u8 to_iso_week_of_year(i32 year, u8 month, u8 day)
|
|||
// 12.1.36 BuildISOMonthCode ( month ), https://tc39.es/proposal-temporal/#sec-buildisomonthcode
|
||||
String build_iso_month_code(u8 month)
|
||||
{
|
||||
// 1. Let numberPart be ToZeroPaddedDecimalString(month, 2).
|
||||
// 2. Return the string-concatenation of "M" and numberPart.
|
||||
return String::formatted("M{:02}", month);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue