el-date-picker 时间选择范围限制


 <el-date-picker
              v-if="viewer===''||viewer==='creator' || subTaskInfo.status !== 2"
              v-model="ruleForm.planEndtime"
              value-format="yyyy-MM-dd hh:mm:ss"
              type="date"
              :picker-options="pickerTime"
              :disabled="subTaskInfo.disable"
              @change="compareDate"
            />

 //  时间选择范围限制
      pickerTime: {
          disabledDate(time) {
             return time.getTime()< moment(window.matterTark.planStarttime)-24 * 3600 * 1000 || time.getTime()> moment(window.matterTark.planEndtime)+24 * 3600 * 1000;
          },
      },

相关