code: function _calculateTime (amount, unit, isSet) {
    switch (unit) {
      case 'YY':
      case 'YYYY':
        amount = isSet ? amount : this.getFullYear() + amount
        this.setFullYear(amount)
        break
      case 'MM':
        amount = isSet ? amount - 1 : this.getMonth() + amount
        this.setMonth(amount)
        break
      case 'DD':
        amount = isSet ? amount : this.getDate() + amount
        this.setDate(amount)
        break
      case 'hh':
        amount = isSet ? amount : this.getHours() + amount
        this.setHours(amount)
        break
      case 'mm':
        amount = isSet ? amount : this.getMinutes() + amount
        this.setMinutes(amount)
        break
      case 'ss':
        amount = isSet ? amount : this.getSeconds() + amount
        this.setSeconds(amount)
        break
      case 'SSS':
        amount = isSet ? amount : this.getMilliseconds() + amount
        this.setMilliseconds(amount)
        break
      case 'ww':
      case 'WW':
        if (isSet) {
          this.setMonth(0)
          this.setDate(1)
          this.setDate(amount * 7)
          firstDayOfWeek.call(this)
        } else {
          this.setDate(this.getDate() + amount * 7)
        }
        break
    }
  }
docs: 内部方法 计算时间