let weekOfDay = parseInt(moment().format('E')); //计算今天是这周第几天
const initFirstDate = moment().weekday(1).format('YYYY-MM-DD');
const initLastDate = moment() .add(7 - weekOfDay + 7 * 1, 'days') .format('YYYY-MM-DD'); //周日日期
let weekOfDay = parseInt(moment().format('E')); //计算今天是这周第几天
const initFirstDate = moment().weekday(1).format('YYYY-MM-DD');
const initLastDate = moment() .add(7 - weekOfDay + 7 * 1, 'days') .format('YYYY-MM-DD'); //周日日期
本文标题:momentJS获取最近两周日期
本文链接:https://www.haomeiwen.com/subject/pmyboltx.html
网友评论