Answers for "get all mondays between two dates"

1

get all mondays between two dates

var start = moment('2016-09-01'), // Sept. 1st
    end   = moment('2016-11-02'), // Nov. 2nd
    day   = 0;                    // Sunday

var result = [];
var current = start.clone();

while (current.day(7 + day).isBefore(end)) {
  result.push(current.clone());
}

console.log(result.map(m => m.format('LLLL')));
Posted by: Guest on August-21-2021

Code answers related to "get all mondays between two dates"

Browse Popular Code Answers by Language