compare-week
v1.0.0
Published
Check if two dates is within the same week
Downloads
98
Readme
compare-week
Check if two dates is within the same week
Install
$ npm install --save compare-week
Usage
const compareWeek = require('compare-week');
compareWeek(new Date(), new Date());
//=> true
compareWeek(new Date(), new Date(new Date() - (1000 * 60 * 60 * 24 * 7)));
//=> false
API
compareWeek(a, b)
a, b
Type: number
Date
Accepts a Unix timestamp or a Date
object.
License
MIT © Kevin Martensson