Generate a range of dates
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore initial commit Mar 2, 2014
.jshintrc tests done Mar 3, 2014
.travis.yml tests done Mar 3, 2014
LICENSE Initial commit Mar 2, 2014
README.md update readme with travis Mar 3, 2014
index.js change date check Mar 3, 2014
package.json update readme with travis Mar 3, 2014
test.js tests done Mar 3, 2014

README.md

Build Status

date-range

Generate a range of dates

Install

npm i --save date-range

Usage

var range = require('date-range');

var end = new Date();
end.setHours(0); end.setMinutes(0); end.setSeconds(0); end.setMilliseconds(0);
var start = new Date(end - (range.DAY * 5));

console.log(range(start, end));
/*
[ Wed Feb 26 2014 00:00:00 GMT-0500 (EST),
  Thu Feb 27 2014 00:00:00 GMT-0500 (EST),
  Fri Feb 28 2014 00:00:00 GMT-0500 (EST),
  Sat Mar 01 2014 00:00:00 GMT-0500 (EST),
  Sun Mar 02 2014 00:00:00 GMT-0500 (EST),
  Mon Mar 03 2014 00:00:00 GMT-0500 (EST) ]
*/

Author

Trevor Landau

Contributing

  • Suggestions welcome!
  • Write new tests for new functionality or changes.
  • Ensure tests pass.
  • Ping me on twitter if I take too long to respond! That probably means I missed the alert/email.