Incident Dossier
The Invoice That Stuck Around For An Extra Month
A billing service computes the next invoice date by adding N months to the customer's billing anchor and clamping to the last day of the target month when the day is shorter. Mar 31 + 1 month should become Apr 30, Dec 15 + 2 months should become Feb 15 of the following year, and Jan 31 + 1 month should collapse to Feb 28 (or Feb 29 in leap years). The clamp helper is right; the result formatter is reading a month index that's already been corrected once — and so every invoice is dated one month LATER than what the math intended.
Initial failing signaladdMonths(2026, 3, 31, 1) returns 2026-05-30 instead of 2026-04-30Expected behavior: 2026-04-30 (Apr 30) · actual behavior: 2026-05-30 (May 30)