npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

compare-week

1.0.0

@kevva

npmHomeRepoSnykSocket
Downloads:103
$ npm install compare-week
DailyWeeklyMonthlyYearly

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