Skip to content

Commit 1c12b16

Browse files
committed
[fixed] DST issue with events
fixes jquense#41, well works around it, by being a bit fuzzier with the calculations
1 parent f526e23 commit 1c12b16

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/dates.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ let dates = Object.assign(dateMath, {
121121
if (!unit)
122122
return Math.abs(+dateA - +dateB)
123123

124-
return Math.abs(
124+
// the .round() handles an edge case
125+
return Math.round(Math.abs(
125126
(+dates.startOf(dateA, unit) / MILLI[unit]) - (+dates.startOf(dateB, unit) / MILLI[unit])
126-
)
127+
))
127128
},
128129

129130
total(date, unit) {

0 commit comments

Comments
 (0)