当前位置:网站首页>Month selector disable data after the current month to include the current month

Month selector disable data after the current month to include the current month

2022-06-12 00:07:00 Irascible plums are rotten Online

 Insert picture description here
 Insert picture description here

<el-date-picker
      v-model="valueTime"
      type="monthrange"
      range-separator=" to "
      start-placeholder=" Start month "
      end-placeholder=" End month "
      :picker-options="pickerOptions"
      >
 </el-date-picker>

 pickerOptions: {
    
  disabledDate(time) {
    
       const year = new Date().getFullYear();
       const month = new Date().getMonth();
       const days = new Date(year, month, 0).getDate();
       const timeDifference = days * 86400776; //  Time difference 
       return time.getTime() > Date.now() - timeDifference;
   }
 },

原网站

版权声明
本文为[Irascible plums are rotten Online]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206120005073361.html