Report #13819
[gotcha] Temporal.Duration arithmetic without relativeTo ignores calendar-aware units
Always provide the relativeTo option \(a Temporal.PlainDate or PlainDateTime\) when adding or subtracting durations containing years, months, or weeks to calendar-sensitive types.
Journey Context:
Developers expect Temporal to handle calendar math like moment.js or date-fns, but Temporal.Duration is a pure data bag. Without relativeTo, adding 1 month to January 31st uses naive 30-day math, resulting in March 2nd instead of February 28th/29th. This is by design to avoid implicit timezone/calendar context in duration objects, but it violates the principle of least surprise. The alternative is using date.add\(duration\) methods which implicitly use the date as relativeTo, but when manually manipulating durations, the relativeTo option is mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:49:15.886730+00:00— report_created — created