function getDateArr(){
let weekArr = ["周日", "周一", "周二", "周三","周四","周五","周六"];
let myDate = new Date();
myDate.setDate(myDate.getDate());
let dateArray = [];
let dateTemp;
let flag = 1;
for (let i = 0; i < 5; i++) {
dateTemp =
dateArray.push({
"date": (myDate.getMonth()+1)+"-"+myDate.getDate(),
"week": weekArr[myDate.getDay()]
});
myDate.setDate(myDate.getDate() + flag);
}
console.log(dateArray);
return dateArray;
}
getDateArr();
function getTitle(str){
let pattern = new RegExp("((.*))");
return str.match(pattern)[1];
}
网友评论