📌  相关文章
📜  获取一个月中的所有星期一日期 jquery - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:26.908000             🧑  作者: Mango

代码示例2
function mondaysInMonth(m,y) {
  var days = new Date(y,m,0).getDate();
  var mondays =  new Date(m +'/01/'+ y).getDay();
  if(mondays != 1){
    mondays = 9 - mondays;
  }
  mondays = [mondays];
  //console.log(mondays);
  for (var i = mondays[0] + 7; i <= days; i += 7) {
    mondays.push(i);
  }
  return mondays;
}