diff --git a/src/utils/common.js b/src/utils/common.js index 69c795d0..1e2d12ef 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -5,8 +5,9 @@ const formatDate = date => { const day = tempDate.getDate() return `${[year, month, day].map(formatNumber).join('-')}` } -const formatDate1 = () => { - let tempDate = new Date() +const formatDate1 = date => { + let value=date.replace(/\./g, '/') + let tempDate = new Date(value) const year = tempDate.getFullYear() const month = tempDate.getMonth() + 1 const day = tempDate.getDate() diff --git a/src/views/index/driverAdd.vue b/src/views/index/driverAdd.vue index 3ed05979..f64490f1 100644 --- a/src/views/index/driverAdd.vue +++ b/src/views/index/driverAdd.vue @@ -275,15 +275,7 @@ export default { }); this.idCardAuthority=res.data.authority let date=res.data.validDate.split('-') - // let tempDate = new Date(date[0]) - // let year=tempDate.getFullYear() - // this.$toast("date=="+tempDate+year) - // let dateStartTime=date[0].split('.') - // console.log("dateStartTime",dateStartTime) - // this.idCardValidStartTime=dateStartTime[0] + dateStartTime[1] +dateStartTime[2] +' '+ '00:00:00'; this.idCardValidStartTime=formatDate1(date[0]) +' '+ '00:00:00'; - this.$toast("idCardValidStartTime=="+this.idCardValidStartTime) - console.log("==",this.idCardValidStartTime) if(date[1] == '长期'){ this.idCardValidEndTime='2099/12/12' +' '+ '00:00:00'; }else{