task#13769,时间格式

This commit is contained in:
2024-05-15 20:04:49 +08:00
parent 8af98c5ef3
commit a6156be569
2 changed files with 3 additions and 10 deletions

View File

@ -5,8 +5,9 @@ const formatDate = date => {
const day = tempDate.getDate() const day = tempDate.getDate()
return `${[year, month, day].map(formatNumber).join('-')}` return `${[year, month, day].map(formatNumber).join('-')}`
} }
const formatDate1 = () => { const formatDate1 = date => {
let tempDate = new Date() let value=date.replace(/\./g, '/')
let tempDate = new Date(value)
const year = tempDate.getFullYear() const year = tempDate.getFullYear()
const month = tempDate.getMonth() + 1 const month = tempDate.getMonth() + 1
const day = tempDate.getDate() const day = tempDate.getDate()

View File

@ -275,15 +275,7 @@ export default {
}); });
this.idCardAuthority=res.data.authority this.idCardAuthority=res.data.authority
let date=res.data.validDate.split('-') 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.idCardValidStartTime=formatDate1(date[0]) +' '+ '00:00:00';
this.$toast("idCardValidStartTime=="+this.idCardValidStartTime)
console.log("==",this.idCardValidStartTime)
if(date[1] == '长期'){ if(date[1] == '长期'){
this.idCardValidEndTime='2099/12/12' +' '+ '00:00:00'; this.idCardValidEndTime='2099/12/12' +' '+ '00:00:00';
}else{ }else{