End-of-month edge cases (PR #2759)
- From André Bargull (Firefox impl.) and Adam Shaw (polyfill author)
- Unexpected
since
/until
result near end of month
const end = new Temporal.PlainDate(1970, 2, 28);
new Temporal.PlainDate(1970, 1, 28).until(end, {largestUnit:"months"})
new Temporal.PlainDate(1970, 1, 29).until(end, {largestUnit:"months"})
new Temporal.PlainDate(1970, 1, 30).until(end, {largestUnit:"months"})
new Temporal.PlainDate(1970, 1, 31).until(end, {largestUnit:"months"})
- Expected (e.g. java.time): 1 month, 30 days, 29 days, 28 days resp.
- Affects
largestUnit: 'months'|'years'
(default options are OK)
- Narrow scope: one-line change affects only 0.2% of date pairs