?文章來源:http://www.zghlxwxcb.cn/news/detail-676960.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-676960.html
changeStartTime(val){
debugger
this.startT = val
// this.startTime = parseInt(val.split('-').join(''))
this.startTime = moment(val).unix() * 1000 //開始時間毫秒
if(this.endTime){
this.endTime = moment(this.endT).unix() * 1000 //結束時間毫秒
if(this.startTime - this.endTime >= 0){
this.$message.warning('培訓開始時間不能大于培訓結束時間!')
this.form.trainTime = ''
this.form.trainDuration = ''
}else{
const sc = (this.endTime - this.startTime) /1000 / 60 / 60 + 'h'
this.form.trainDuration = sc
}
}
},
changeEndTime(val){
this.endT = val
// this.endTime = parseInt(val.split('-').join(''))
this.endTime = moment(val).unix() * 1000 //開始時間毫秒
if(this.startTime){
this.startTime = moment(this.startT).unix() * 1000 //結束時間毫秒
if(this.endTime - this.startTime <=0 ){
this.$message.warning('培訓結束時間不能小于培訓開始時間!')
this.form.completeTime = ''
this.form.trainDuration = ''
}else{
const sc = (this.endTime - this.startTime) /1000 / 60 / 60 + 'h'
this.form.trainDuration = sc
}
}
},
到了這里,關于elementUI moment 年月日轉時間戳 時間限制的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!