talk is cheap,show me the code! //获取昨天 var day1 = new Date(); day1.setTime(day1.getTime()-24*60*60*1000); var yesterDate = day1.getFullYear()+"/" + (day1.getMonth()+1) + "/" + day1.getDate(); //获取当前日期 var date = new Date(); var year =…
function formatDate (val) { // 格式化时间 let start = new Date(val) let y = start.getFullYear() let m = (start.getMonth() + 1) > 10 ? (start.getMonth() + 1) : '0' + (start.getMonth() + 1) let d = start.getDate() > 10 ? start.getDate() : '0' + start.getDa…
//obtain timestamp of last week var now=new Date() var nowDayOfWeek = now.getDay(); //今天本周的第几天 var nowDay = now.getDate(); //当前日 var nowMonth = now.getMonth(); //当前月 var nowYear = now.getFullYear(); //当前年 //obtain time of last month var lastMonthDate…