根據(jù)今天日期獲取今天星期幾
const getWeekday = day => {
let weekArr = [ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" ];
let week = weekArr[newDate(day).getDay()];
return week;
}
const newDate = strdate => {
let arr = strdate.split(/[- : \/]/);
let date = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]);
return date;
}