Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Fix date difference for end-of-month edge cases #2759

Merged
merged 2 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions polyfill/lib/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3708,8 +3708,7 @@ export function RejectDuration(y, mon, w, d, h, min, s, ms, µs, ns) {
}

function ISODateSurpasses(sign, y1, m1, d1, y2, m2, d2) {
const constrained = ConstrainISODate(y1, m1, d1);
const cmp = CompareISODate(constrained.year, constrained.month, constrained.day, y2, m2, d2);
const cmp = CompareISODate(y1, m1, d1, y2, m2, d2);
return sign * cmp === 1;
}

Expand Down
3 changes: 1 addition & 2 deletions spec/plaindate.html
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,7 @@ <h1>
</dd>
</dl>
<emu-alg>
1. Let _constrained_ be ! RegulateISODate(_y1_, _m1_, _d1_, *"constrain"*).
1. Let _comparison_ be CompareISODate(_constrained_.[[Year]], _constrained_.[[Month]], _constrained_.[[Day]], _y2_, _m2_, _d2_).
1. Let _comparison_ be CompareISODate(_y1_, _m1_, _d1_, _y2_, _m2_, _d2_).
1. If _sign_ &times; _comparison_ is 1, return *true*.
1. Return *false*.
</emu-alg>
Expand Down
Loading