Skip to content

Commit

Permalink
DateTime.diff produces wrong results with unit quarter fix. (#1279)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyac03 authored Sep 12, 2022
1 parent 42e1e4b commit d84e44c
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 d84e44c

Please sign in to comment.