1.获取系统当前时间 getNowTime(tempminit) { if (!tempminit) { tempminit = 0; } var date = new Date(); date.setMinutes(date.getMinutes() - tempminit); var year = date.getFullYear(), month = date.getMonth() + 1, day = date.getDate(), hour = date.getHours() < 10
function status(item){ let now = Date.parse(new Date()); let startString = Date.parse(new Date(Date.parse((item.startTime+'').replace(/-/g, "/")))); let endString = Date.parse(new Date(Date.parse((item.endTime+'').replace(/-/g, "/"))))
let d1 = new Date() let d2 = new Date() d2.setMonth(0) d2.setDate(1) let rq = d1-d2 let s1 = Math.ceil(rq/(24*60*60*1000)) let s2 = Math.ceil(s1/7) console.log('第' + s1 + '天,第' + s2 + '周')