diff options
author | Linus Groh <mail@linusgroh.de> | 2022-04-29 21:09:10 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-04-29 22:40:46 +0200 |
commit | 27793bf76cdc7690b688297b4b648e05f69c2018 (patch) | |
tree | 1409f405d08677ed5a5534eadb1097897b6ca876 /Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp | |
parent | df1f81ba90b6cf70d787cfc26e56c0ae7aebc58a (diff) | |
download | serenity-27793bf76cdc7690b688297b4b648e05f69c2018.zip |
LibJS: Replace U+2212 MINUS SIGN with U+002D HYPHEN-MINUS
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/bbcd37b
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index 7d8516c50a..1243776e4c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -159,7 +159,7 @@ DateDurationRecord difference_iso_date(GlobalObject& global_object, i32 year1, u // d. Let end be the Record { [[Year]]: y2, [[Month]]: m2, [[Day]]: d2 }. auto end = ISODate { .year = year2, .month = month2, .day = day2 }; - // e. Let years be end.[[Year]] − start.[[Year]]. + // e. Let years be end.[[Year]] - start.[[Year]]. double years = end.year - start.year; // f. Let mid be ! AddISODate(y1, m1, d1, years, 0, 0, 0, "constrain"). @@ -178,7 +178,7 @@ DateDurationRecord difference_iso_date(GlobalObject& global_object, i32 year1, u return create_date_duration_record(0, years * 12, 0, 0); } - // i. Let months be end.[[Month]] − start.[[Month]]. + // i. Let months be end.[[Month]] - start.[[Month]]. double months = end.month - start.month; // j. If midSign is not equal to sign, then @@ -281,11 +281,11 @@ DateDurationRecord difference_iso_date(GlobalObject& global_object, i32 year1, u // ii. Let greater be the Record { [[Year]]: y1, [[Month]]: m1, [[Day]]: d1 }. greater = { .year = year1, .month = month1, .day = day1 }; - // iii. Let sign be −1. + // iii. Let sign be -1. sign = -1; } - // c. Let days be ! ToISODayOfYear(greater.[[Year]], greater.[[Month]], greater.[[Day]]) − ! ToISODayOfYear(smaller.[[Year]], smaller.[[Month]], smaller.[[Day]]). + // c. Let days be ! ToISODayOfYear(greater.[[Year]], greater.[[Month]], greater.[[Day]]) - ! ToISODayOfYear(smaller.[[Year]], smaller.[[Month]], smaller.[[Day]]). double days = to_iso_day_of_year(greater.year, greater.month, greater.day) - to_iso_day_of_year(smaller.year, smaller.month, smaller.day); // d. Let year be smaller.[[Year]]. @@ -409,7 +409,7 @@ ISODate balance_iso_date(double year_, double month_, double day) // 4. Set year to balancedYearMonth.[[Year]]. auto year = balanced_year_month.year; - // 5. NOTE: To deal with negative numbers of days whose absolute value is greater than the number of days in a year, the following section subtracts years and adds days until the number of days is greater than −366 or −365. + // 5. NOTE: To deal with negative numbers of days whose absolute value is greater than the number of days in a year, the following section subtracts years and adds days until the number of days is greater than -366 or -365. i32 test_year; @@ -420,19 +420,19 @@ ISODate balance_iso_date(double year_, double month_, double day) } // 7. Else, else { - // a. Let testYear be year − 1. + // a. Let testYear be year - 1. test_year = year - 1; } - // 8. Repeat, while day < −1 × ! ISODaysInYear(testYear), + // 8. Repeat, while day < -1 × ! ISODaysInYear(testYear), while (day < -1 * iso_days_in_year(test_year)) { // a. Set day to day + !ISODaysInYear(testYear). day += iso_days_in_year(test_year); - // b. Set year to year − 1. + // b. Set year to year - 1. year--; - // c. Set testYear to testYear − 1. + // c. Set testYear to testYear - 1. test_year--; } @@ -443,7 +443,7 @@ ISODate balance_iso_date(double year_, double month_, double day) // 11. Repeat, while day > ! ISODaysInYear(testYear), while (day > iso_days_in_year(test_year)) { - // a. Set day to day − ! ISODaysInYear(testYear). + // a. Set day to day - ! ISODaysInYear(testYear). day -= iso_days_in_year(test_year); // b. Set year to year + 1. @@ -457,7 +457,7 @@ ISODate balance_iso_date(double year_, double month_, double day) // 13. Repeat, while day < 1, while (day < 1) { - // a. Set balancedYearMonth to ! BalanceISOYearMonth(year, month − 1). + // a. Set balancedYearMonth to ! BalanceISOYearMonth(year, month - 1). balanced_year_month = balance_iso_year_month(year, month - 1); // b. Set year to balancedYearMonth.[[Year]]. @@ -474,7 +474,7 @@ ISODate balance_iso_date(double year_, double month_, double day) // 15. Repeat, while day > ! ISODaysInMonth(year, month), while (day > iso_days_in_month(year, month)) { - // a. Set day to day − ! ISODaysInMonth(year, month). + // a. Set day to day - ! ISODaysInMonth(year, month). day -= iso_days_in_month(year, month); // b. Set balancedYearMonth to ! BalanceISOYearMonth(year, month + 1). |