📌  相关文章
📜  获取两个日期之间的所有星期一 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:43.628000             🧑  作者: Mango

代码示例1
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')));