Skip to content

Commit

Permalink
return unique week of epoch numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
smhg committed Nov 14, 2018
1 parent 7586c8d commit 5113f20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5113f20

Please sign in to comment.