snowyu / get-nearest-Day-of-week.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get-nearest-day-of-week npm

Build Status Code Climate Test Coverage downloads license

The function return the date to get nearest day of week.

getNearestDayOfWeek(aDate, aDayOfWeek)
  • parameters:
    • aDate (Date|String): the date to search the nearest day.
    • aDayOfWeek(Integer|Array): the nearest day of week(s).
      • 1-7: Monday...Sunday

Usage

var getNearestDayOfWeek = require('get-nearest-day-of-week')
//1-7: Monday...Sunday
getNearestDayOfWeek('2016-9-21', 7)
//=2016-9-18

License

MIT

About

License:MIT License


Languages

Language:CoffeeScript 99.1%Language:JavaScript 0.9%