moment获取上周7天的日期

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