mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 15:36:56 +00:00
[Update] 修改时间日期i18n
This commit is contained in:
parent
1dafaf12aa
commit
60f174fe0e
@ -9,18 +9,14 @@ export default {
|
||||
extends: BaseFormatter,
|
||||
data() {
|
||||
const dt = new Date(this.cellValue)
|
||||
// const year = dt.getFullYear()
|
||||
// const month = dt.getMonth() + 1
|
||||
// const date = dt.getDate()
|
||||
// const hour = dt.getHours()
|
||||
// const minutes = dt.getMinutes()
|
||||
// const seconds = dt.getSeconds()
|
||||
const value = this.$d(dt, 'medium')
|
||||
// const locale = this.$i18n.locale
|
||||
// const value = dt.toLocaleString(locale, { hourCycle: 'h23' })
|
||||
// console.log(this.$i18n.locale)
|
||||
return { value: value }
|
||||
// return {
|
||||
// value: `${year}-${month}-${date} ${hour}:${minutes}:${seconds}`
|
||||
// }
|
||||
return {
|
||||
value: this.$d(dt, 'long')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -3,18 +3,28 @@ export default {
|
||||
short: {
|
||||
year: 'numeric', month: 'short', day: 'numeric'
|
||||
},
|
||||
medium: {
|
||||
year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
hour: '2-digit', minute: '2-digit', second: '2-digit',
|
||||
hourCycle: 'h23', hour12: false
|
||||
},
|
||||
long: {
|
||||
year: 'numeric', month: 'short', day: 'numeric',
|
||||
weekday: 'short', hour: 'numeric', minute: 'numeric'
|
||||
hour: 'numeric', minute: 'numeric'
|
||||
}
|
||||
},
|
||||
'cn': {
|
||||
short: {
|
||||
year: 'numeric', month: 'short', day: 'numeric'
|
||||
},
|
||||
medium: {
|
||||
year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
hour: '2-digit', minute: '2-digit', second: '2-digit',
|
||||
hourCycle: 'h23', hour12: false
|
||||
},
|
||||
long: {
|
||||
year: 'numeric', month: 'short', day: 'numeric',
|
||||
weekday: 'short', hour: 'numeric', minute: 'numeric', hour12: true
|
||||
hour: 'numeric', minute: 'numeric', hour12: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user