Frequently asked questions
How does adding months handle different month lengths?
If adding a month would land on a day that doesn't exist (like January 31 + 1 month), the date rolls forward to the equivalent valid date — the same logic JavaScript's native date handling uses, which can occasionally produce a date later in the following month than expected.
Does this account for leap years?
Yes — both the add/subtract and difference modes use real calendar math, so February 29 in a leap year is correctly counted.