let startTime=new Date(this.seachObj.times[0])
 startTime=startTime.getFullYear() + '' + this.p(startTime.getMonth() + 1) + '' + this.p(startTime.getDate())+ ' '+this.p(startTime.getHours()) + ':' + this.p(startTime.getMinutes()) + ':' + this.p(startTime.getSeconds())
 let endTime=new Date(this.seachObj.times[1])
 endTime=endTime.getFullYear() + '' + this.p(endTime.getMonth() + 1) + '' + this.p(endTime.getDate())+ ' '+this.p(endTime.getHours()) + ':' + this.p(endTime.getMinutes()) + ':' + this.p(endTime.getSeconds())
 
 
补0方法
p (s) {
return s < 10 ? '0' + s : s;
},
posted on 2018-06-30 17:15  鄢宁  阅读(496)  评论(0编辑  收藏  举报