当前位置:网站首页>El date picker limits the selection range from the current time to two months ago

El date picker limits the selection range from the current time to two months ago

2022-04-23 17:03:00 Eli-sun

<span class="demonstration"> Time :</span>
      <el-date-picker
        v-model="daterange"
        style="width:240px"
        type="daterange"
        range-separator="-"
        start-placeholder=" Start date "
        end-placeholder=" End date "
        :picker-options="pickerOptions"
      />
 stay return It says in it :
pickerOptions: {
    disabledDate: time => {
      const day = 60 * 24 * 3600 * 1000 // 31536000000
      //  Returns a date less than the current date and within two months 
      return time.getTime() > Date.now() || time.getTime() < (Date.now() - 8.64e7) - day
    }
  },

版权声明
本文为[Eli-sun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230554290182.html