mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibJS: Reverse date comparison in DifferenceISODateTime
This is an editorial change in the Temporal proposal. See: https://github.com/tc39/proposal-temporal/commit/4a8cdb5
This commit is contained in:
parent
16aebef4f4
commit
5c0c1e507c
Notes:
github-actions[bot]
2024-12-05 21:07:19 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/5c0c1e507c4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2790 Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 4 deletions
|
@ -300,14 +300,14 @@ InternalDuration difference_iso_date_time(VM& vm, ISODateTime const& iso_date_ti
|
|||
// 4. Let timeSign be TimeDurationSign(timeDuration).
|
||||
auto time_sign = time_duration_sign(time_duration);
|
||||
|
||||
// 5. Let dateSign be CompareISODate(isoDateTime2.[[ISODate]], isoDateTime1.[[ISODate]]).
|
||||
auto date_sign = compare_iso_date(iso_date_time2.iso_date, iso_date_time1.iso_date);
|
||||
// 5. Let dateSign be CompareISODate(isoDateTime1.[[ISODate]], isoDateTime2.[[ISODate]]).
|
||||
auto date_sign = compare_iso_date(iso_date_time1.iso_date, iso_date_time2.iso_date);
|
||||
|
||||
// 6. Let adjustedDate be isoDateTime2.[[ISODate]].
|
||||
auto adjusted_date = iso_date_time2.iso_date;
|
||||
|
||||
// 7. If timeSign = -dateSign, then
|
||||
if (time_sign == -date_sign) {
|
||||
// 7. If timeSign = dateSign, then
|
||||
if (time_sign == date_sign) {
|
||||
// a. Set adjustedDate to BalanceISODate(adjustedDate.[[Year]], adjustedDate.[[Month]], adjustedDate.[[Day]] + timeSign).
|
||||
adjusted_date = balance_iso_date(adjusted_date.year, adjusted_date.month, static_cast<double>(adjusted_date.day) + time_sign);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue