对datepicker操作实现写入日期和清空日期

 

对datepicker操作实现写入日期和清空日期_第1张图片

给datepicker设置日期:

 var now = new Date();
          year = now.getFullYear();
          month = now.getMonth() + 1;
          var day = now.getDate();
          let str1=year+"-"+month+"-"+day+" "+"00:00";
          let str2=year+"-"+month+"-"+day+" "+"23:59";
          this.sxContent=[str1,str2];
          this.dateModel=[new Date(str1),new Date(str2)];

清空datepicker日期:

this.dateModel="";

 

你可能感兴趣的:(对datepicker操作实现写入日期和清空日期)