From 5113f20025b7873218ad0865cae26b46bbf7d44b Mon Sep 17 00:00:00 2001 From: smhg Date: Wed, 14 Nov 2018 12:32:44 +0100 Subject: [PATCH] return unique week of epoch numbers --- src/util/date.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/date.js b/src/util/date.js index 102a64d..5c2ec47 100644 --- a/src/util/date.js +++ b/src/util/date.js @@ -9,7 +9,7 @@ const weekday = date => (date.getDay() + 6) % 7 + 1; const weekEpoch = new Date(1970, 0, -2); // monday before unix epoch in local timezone const weekOfEpoch = date => - Math.abs(Math.floor((date - weekEpoch + (weekEpoch.getTimezoneOffset() - date.getTimezoneOffset()) * MINUTE) / WEEK)); + Math.floor((date - weekEpoch + (weekEpoch.getTimezoneOffset() - date.getTimezoneOffset()) * MINUTE) / WEEK); function modify (date, unit, value) { switch (unit) {