task#13769,时间测试
This commit is contained in:
@ -5,7 +5,13 @@ const formatDate = date => {
|
||||
const day = tempDate.getDate()
|
||||
return `${[year, month, day].map(formatNumber).join('-')}`
|
||||
}
|
||||
|
||||
const formatDate1 = date => {
|
||||
let tempDate = new Date(date)
|
||||
const year = tempDate.getFullYear()
|
||||
const month = tempDate.getMonth() + 1
|
||||
const day = tempDate.getDate()
|
||||
return `${[year, month, day].map(formatNumber).join('/')}`
|
||||
}
|
||||
const formatNumber = n => {
|
||||
n = n.toString()
|
||||
return n[1] ? n : `0${n}`
|
||||
@ -40,5 +46,6 @@ module.exports = {
|
||||
formatNumber,
|
||||
formatDate,
|
||||
leftCopy,
|
||||
timeFormat
|
||||
timeFormat,
|
||||
formatDate1
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ import {myMixins} from "@/utils/myMixins"
|
||||
import {saveDriver, uploadImage, ocrHandler} from "@/api/mine"
|
||||
import TwoCommonBtn from "@/components/twoBtnCommon.vue"
|
||||
import CellGroup from "@/components/cellGroup.vue"
|
||||
import {formatDate} from "@/utils/common"
|
||||
import {formatDate1} from "@/utils/common"
|
||||
export default {
|
||||
name: "driverAdd",
|
||||
mixins:[myMixins],
|
||||
@ -275,17 +275,17 @@ export default {
|
||||
});
|
||||
this.idCardAuthority=res.data.authority
|
||||
let date=res.data.validDate.split('-')
|
||||
this.$toast("date=="+date[0])
|
||||
// this.$toast("date=="+date[0])
|
||||
// let dateStartTime=date[0].split('.')
|
||||
// console.log("dateStartTime",dateStartTime)
|
||||
// this.idCardValidStartTime=dateStartTime[0] + dateStartTime[1] +dateStartTime[2] +' '+ '00:00:00';
|
||||
this.idCardValidStartTime=formatDate(date[0]) +' '+ '00:00:00';
|
||||
// this.$toast("idCardValidStartTime=="+this.idCardValidStartTime)
|
||||
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';
|
||||
this.idCardValidEndTime='2099/12/12' +' '+ '00:00:00';
|
||||
}else{
|
||||
this.idCardValidEndTime=formatDate(date[1]) +' '+ '00:00:00';
|
||||
this.idCardValidEndTime=formatDate1(date[1]) +' '+ '00:00:00';
|
||||
}
|
||||
console.log("==",this.idCardValidEndTime)
|
||||
},
|
||||
|
Reference in New Issue
Block a user