Check if two dates are within the same week
$ npm install --save compare-week
const compareWeek = require('compare-week');
compareWeek(new Date(), new Date());
//=> true
compareWeek(new Date(), new Date(new Date() - (1000 * 60 * 60 * 24 * 7)));
//=> false
Type: number
Date
Accepts a Unix timestamp or a Date
object.
MIT © Kevin Martensson