From 1c12b16167550ab217c357972a2bbadf295b3298 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sun, 3 Apr 2016 10:07:02 -0400 Subject: [PATCH] [fixed] DST issue with events fixes #41, well works around it, by being a bit fuzzier with the calculations --- src/utils/dates.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/dates.js b/src/utils/dates.js index dbccfc135..d29009622 100644 --- a/src/utils/dates.js +++ b/src/utils/dates.js @@ -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) {