moment 获取本周7天的日期

js yekong 74℃
      const startDate = moment().week(moment().week() - 0).startOf('week').format('YYYYMMDD')
      that.dateArr = []
      that.dateArr.push(moment(startDate).subtract(0, 'days').format('YYYYMMDD'))
      that.dateArr.push(moment(startDate).subtract(-1, 'days').format('YYYYMMDD'))
      that.dateArr.push(moment(startDate).subtract(-2, 'days').format('YYYYMMDD'))
      that.dateArr.push(moment(startDate).subtract(-3, 'days').format('YYYYMMDD'))
      that.dateArr.push(moment(startDate).subtract(-4, 'days').format('YYYYMMDD'))
      that.dateArr.push(moment(startDate).subtract(-5, 'days').format('YYYYMMDD'))
      that.dateArr.push(moment(startDate).subtract(-6, 'days').format('YYYYMMDD'))
      console.log('this week')
喜欢 (0)