get-next-dates

1.0.0 • Public • Published

get-next-dates

GetNextDates(range[, startDate])

Returns an array of Date objects to the specified length, representing the calendar dates following the Date object supplied.

If no date object is supplied, the current time is used as the start date. Range is required, and must be a positive integer. If an invalid range or date is given, an error is thrown.

Install

$ npm install get-next-dates --save

Usage

GetNextDates(range, startDate)

const GetNextDates = require('get-next-dates');

let nextSevenDays = GetNextDates(7);
// Array of 7 Date objects, starting with tomorrow

let milleniumEve = new Date(1999, 11, 31);
let first100DaysOfCentury = GetNextDates(100, milleniumEve);
// Array of 100 Date objects, starting with Jan 1, 2000

Readme

Keywords

none

Package Sidebar

Install

npm i get-next-dates

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • rossb