|
495 | 495 | 1. If _calendar_ is *"iso8601"*, then
|
496 | 496 | 1. Let _intermediate_ be BalanceISOYearMonth(_isoDate_.[[Year]] + _duration_.[[Years]], _isoDate_.[[Month]] + _duration_.[[Months]]).
|
497 | 497 | 1. Set _intermediate_ to ? RegulateISODate(_intermediate_.[[Year]], _intermediate_.[[Month]], _isoDate_.[[Day]], _overflow_).
|
498 |
| - 1. Let _d_ be _intermediate_.[[Day]] + _duration_.[[Days]] + 7 × _duration_.[[Weeks]]. |
499 |
| - 1. Let _result_ be BalanceISODate(_intermediate_.[[Year]], _intermediate_.[[Month]], _d_). |
| 498 | + 1. Let _days_ be _duration_.[[Days]] + 7 × _duration_.[[Weeks]]. |
| 499 | + 1. Let _result_ be AddDaysToISODate(_intermediate_, _days_). |
500 | 500 | 1. Else,
|
501 | 501 | 1. Let _result_ be an implementation-defined ISO Date Record, or throw a *RangeError* exception, as described below.
|
502 | 502 | 1. If ISODateWithinLimits(_result_) is *false*, throw a *RangeError* exception.
|
@@ -547,18 +547,18 @@ <h1>
|
547 | 547 | 1. Let _weeks_ be 0.
|
548 | 548 | 1. If _largestUnit_ is ~week~, then
|
549 | 549 | 1. Let _candidateWeeks_ be _sign_.
|
550 |
| - 1. Set _intermediate_ to BalanceISODate(_constrained_.[[Year]], _constrained_.[[Month]], _constrained_.[[Day]] + 7 × _candidateWeeks_). |
| 550 | + 1. Set _intermediate_ to AddDaysToISODate(_constrained_, 7 × _candidateWeeks_). |
551 | 551 | 1. Repeat, while ISODateSurpasses(_sign_, _intermediate_.[[Year]], _intermediate_.[[Month]], _intermediate_.[[Day]], _two_) is *false*,
|
552 | 552 | 1. Set _weeks_ to _candidateWeeks_.
|
553 | 553 | 1. Set _candidateWeeks_ to _candidateWeeks_ + sign.
|
554 |
| - 1. Set _intermediate_ to BalanceISODate(_intermediate_.[[Year]], _intermediate_.[[Month]], _intermediate_.[[Day]] + 7 × _sign_). |
| 554 | + 1. Set _intermediate_ to AddDaysToISODate(_intermediate_, 7 × _sign_). |
555 | 555 | 1. Let _days_ be 0.
|
556 | 556 | 1. Let _candidateDays_ be _sign_.
|
557 |
| - 1. Set _intermediate_ to BalanceISODate(_constrained_.[[Year]], _constrained_.[[Month]], _constrained_.[[Day]] + 7 × _weeks_ + _candidateDays_). |
| 557 | + 1. Set _intermediate_ to AddDaysToISODate(_constrained_, 7 × _weeks_ + _candidateDays_). |
558 | 558 | 1. Repeat, while ISODateSurpasses(_sign_, _intermediate_.[[Year]], _intermediate_.[[Month]], _intermediate_.[[Day]], _two_) is *false*,
|
559 | 559 | 1. Set _days_ to _candidateDays_.
|
560 | 560 | 1. Set _candidateDays_ to _candidateDays_ + _sign_.
|
561 |
| - 1. Set _intermediate_ to BalanceISODate(_intermediate_.[[Year]], _intermediate_.[[Month]], _intermediate_.[[Day]] + _sign_). |
| 561 | + 1. Set _intermediate_ to AddDaysToISODate(_intermediate_, _sign_). |
562 | 562 | 1. Return ! CreateDateDurationRecord(_years_, _months_, _weeks_, _days_).
|
563 | 563 | 1. Return an implementation-defined Date Duration Record as described above.
|
564 | 564 | </emu-alg>
|
|
0 commit comments