Calendar or duration rule
Calendar month shifting changes the year/month while preserving a valid day when possible.
Month-end dates need explicit handling because months have different lengths.
Worked check
Month arithmetic needs extra care near the 29th, 30th and 31st because not every destination month has the same number of days. After shifting a month-end date, inspect the returned calendar date rather than assuming that adding one month means adding a fixed number of days.
Rule: Calendar month shifting changes the year/month while preserving a valid day when possible. Month-end dates need explicit handling because months have different lengths. For a final check, distinguish calendar arithmetic from elapsed duration, confirm the intended local date or time zone, and inspect month-end, leap-year or daylight-saving boundaries when they can affect the meaning.
Month rollover policy
Adding months is calendar arithmetic, not a fixed number of days. When the target month is shorter, the day is clamped instead of letting JavaScript silently spill into a later month.