We currently have nextMonth and prevMonth, but for consistency with other things that can be added, we should also allow you to add an arbitrary number of months.
Note that addMonths(2) will behave slightly differently than nextMonth >> nextMonth, because nextMonth clamps at each step along the way while addMonths will only clamp once at the end. nextMonth and prevMonth can be re-written to use addMonths without any change in behavior.
We currently have
nextMonth
andprevMonth
, but for consistency with other things that can be added, we should also allow you to add an arbitrary number of months.Note that
addMonths(2)
will behave slightly differently thannextMonth >> nextMonth
, becausenextMonth
clamps at each step along the way whileaddMonths
will only clamp once at the end.nextMonth
andprevMonth
can be re-written to useaddMonths
without any change in behavior.