Skip to content

Commit e84d79f

Browse files
committed
DateTime.diff produces wrong results with unit quarter fix.
1 parent 7480340 commit e84d79f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/impl/diff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function dayDiff(earlier, later) {
99
function highOrderDiffs(cursor, later, units) {
1010
const differs = [
1111
["years", (a, b) => b.year - a.year],
12-
["quarters", (a, b) => b.quarter - a.quarter],
12+
["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],
1313
["months", (a, b) => b.month - a.month + (b.year - a.year) * 12],
1414
[
1515
"weeks",

0 commit comments

Comments
 (0)