Vue date data format

vue

<span>{{ modifyForm.changeId}} </span>

export default {

name: 'modifyDetai',

created () {

if (this.changeId !== undefined) {

this.getDetail()

}

},

filters: {

formatDate: function (value) {

let date = new Date(value)

let y = date.getFullYear()

let MM = date.getMonth() + 1

MM = MM < 10 ? ('0' + MM) : MM

let d = date.getDate()

d = d < 10 ? ('0' + d) : d

let h = date.getHours()

h = h < 10 ? ('0' + h) : h

let m = date.getMinutes()

m = m < 10 ? ('0' + m) : m

let s = date.getSeconds()

s = s < 10 ? ('0' + s) : s

return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s

},

formatInfluence (influence) {

const influenceMap = {

0: 'personal',

1: 'group',

2: 'business',

3: 'company'

}

return influenceMap[influence]

},

formatClassify (classify) {

const classifyMap = {

1: 'Development integration',

2: 'Test integration',

3: 'Emergency release'

}

return classifyMap[classify]

},

formatUrgency (urgency) {

const urgencyMap = {

1: 'Normal',

2: '加急'

}

return urgencyMap[urgency]

},

formatPriority (priority) {

const priorityMap = {

1: 'High',

2: '中',

3: '低'

}

return priorityMap[priority]

},

formatDealgroup (dealgroup) {

const dealgroupMap = {

1: '6677',

2: 'Basic operation and maintenance'

}

return dealgroupMap[dealgroup]

},

formatStatus (status) {

const statusMap = {

0: 'New',

1: 'Change implementation',

2: 'Approval',

3: 'Complete'

}

return statusMap[status]

}

},