Skip to content

Commit

Permalink
[fixed] DST issue with events
Browse files Browse the repository at this point in the history
fixes jquense#41, well works around it, by being a bit fuzzier with the
calculations
  • Loading branch information
jquense committed Apr 3, 2016
1 parent f526e23 commit 1c12b16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ let dates = Object.assign(dateMath, {
if (!unit)
return Math.abs(+dateA - +dateB)

return Math.abs(
// the .round() handles an edge case
return Math.round(Math.abs(
(+dates.startOf(dateA, unit) / MILLI[unit]) - (+dates.startOf(dateB, unit) / MILLI[unit])
)
))
},

total(date, unit) {
Expand Down

0 comments on commit 1c12b16

Please sign in to comment.