1.0.0 • Published 8 years ago

compare-week v1.0.0

Weekly downloads
21
License
MIT
Repository
github
Last release
8 years ago

compare-week Build Status

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