element-plus日期选择器禁用范围

const disabledDate = (time: { getTime: () => number }) => {
  1.三个月-今天
  let curDate = new Date().getTime()
  let three = 90 * 24 * 3600 * 1000
  let threeMonths = curDate - three
  return time.getTime() > Date.now() || time.getTime() < threeMonths
  2.禁用今天以后
     const pickerMaxDate = getUnixZero()
     if (pickerMaxDate) {
     return time.getTime() > 				pickerMaxDate * 1000|| time.getTime() < dayjs().subtract(3, 'month').unix()
   || time.getTime() < dayjs().subtract(3, 'month').unix()}else{
   
     return false
}}

你可能感兴趣的:(javascript,开发语言,ecmascript)