Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Fix date difference for end-of-month edge cases
This adjusts the difference algorithm for Gregorian-year dates so that when an intermediate date occurs past the end of a month, it is not shifted to the end of that month. Previously, in some edge cases where taking the difference in months or years would return a number of months and zero days, we now return one month less and 28, 29, or 30 days instead. Example: 1970-01-29 until 1971-02-28, largestUnit years Old result: 1 year, 1 month New result: 1 year, 30 days Note that largestUnit weeks and largestUnit days, the latter of which is the default, are not affected. Closes: #2535
- Loading branch information