Вы можете использовать эту функцию:
// days is an array of weekdays: 0 is Sunday, ..., 6 is Saturday
const countCertainDays( days, d0, d1 ) {
var ndays = 1 + Math.round((d1-d0)/(24*3600*1000));
var sum = function(a,b) {
return a + Math.floor( (ndays+(d0.getDay()+6-b) % 7 ) / 7 ); };
return days.reduce(sum,0);
}
пример:
countCertainDays([5],new Date(2020,0,1),new Date(2020,2,1))
И еще пример .