diff --git a/src/duration.ts b/src/duration.ts index 77de611..5abf035 100644 --- a/src/duration.ts +++ b/src/duration.ts @@ -182,6 +182,9 @@ export function roundToSingleUnit(duration: Duration, {relativeTo = Date.now()}: } else if (monthsDiff < 11) { months = monthsDiff years = 0 + } else if (monthsDiff === 11) { + months = 0 + years += 1 // the old behavior: "11 months" is rounded to "1 year" } else { months = 0 years = yearDiff * sign