Dool.js is a package inspired by dayjs that allows you to generate the list of days between two dates.
Well, because I needed to schedule things easily, comrade, that's why!
Dr. Drake Ramoray, of course
ya know the drill:
$ npm i dooljs and then:
const{ dool }=require("dooljs");constday1="2013-04-08";constday2=newDate();// today, 2021-01-30constdays=dool(day1,day2);console.log(days.length);// 2855You can look for a specific day of the week :
const{ dool }=require("dooljs");constday1="1972-01-30";constday2=newDate();// today, 2021-01-30constsundays=dool(day1,day2,"sunday");console.log(sundays);/*[ 1972-01-29T23:00:00.000Z, 1972-02-05T23:00:00.000Z, 1972-02-12T23:00:00.000Z, ...]*/console.log(sundays.length);// 2557You can also pass an array of week days:
const{ dool }=require("dooljs");constday1="1990-02-16";constday2=newDate();// today, 2021-01-30constweeknds=dool(day1,day2,["saturday","sunday"]);console.log(weeknds.length);// => 3231 saturdays and sundays (today was a saturday, hence the odd number :D)🤖 Enjoy 🤖