Skip to content

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

Notifications You must be signed in to change notification settings

rossb/get-next-dates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 at tomorrow

let millenium = new Date(2000, 0, 1, 0, 0, 0, 0);
let first100DaysOfCentury = GetNextDates(100, millenium);
// Array of 100 Date objects starting at the millenium

About

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

Resources

Stars

Watchers

Forks

Packages