Package Exports
- days-in-a-row
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (days-in-a-row) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
days-in-a-row
Return an array of dates (strings) based on a start date and a number.
Usage
const days = require('days-in-a-row');
const allTheDays = days(new Date('01/01/2017'), 45);
/* the result
[ '2017-01-01',
'2017-01-02',
...
'2017-02-13',
'2017-02-14' ]
*/
// You can then map the results to javascript date object
const allTheDates = allTheDays((day) => new Date(day));
// Then something like daylight to format the day for display
var daylight = require('daylight');
const prettyDates = allTheDates.map((day) => daylight('l, F jS', day));
/*
[ 'Monday, Jan 1st',
'Tuesday, Jan 2nd',
...
'Monday, Feb 13th',
'Tuesday, Feb 14th' ]
*/