Skip to content

Commit

Permalink
DateTime.diff produces wrong results with unit quarter fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyac03 committed Sep 2, 2022
1 parent 7480340 commit e84d79f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/impl/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function dayDiff(earlier, later) {
function highOrderDiffs(cursor, later, units) {
const differs = [
["years", (a, b) => b.year - a.year],
["quarters", (a, b) => b.quarter - a.quarter],
["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],
["months", (a, b) => b.month - a.month + (b.year - a.year) * 12],
[
"weeks",
Expand Down

0 comments on commit e84d79f

Please sign in to comment.