use NumberFormat
This commit is contained in:
parent
c31e9466b7
commit
f112724a5a
1 changed files with 4 additions and 5 deletions
|
|
@ -107,16 +107,15 @@ const FilteringTab = {
|
||||||
...mapActions(useServerSideStorageStore, ['setPreference', 'unsetPreference', 'pushServerSideStorage']),
|
...mapActions(useServerSideStorageStore, ['setPreference', 'unsetPreference', 'pushServerSideStorage']),
|
||||||
getDatetimeLocal (timestamp) {
|
getDatetimeLocal (timestamp) {
|
||||||
const date = new Date(timestamp)
|
const date = new Date(timestamp)
|
||||||
|
let fmt = new Intl.NumberFormat("en-US", {minimumIntegerDigits: 2})
|
||||||
const datetime = [
|
const datetime = [
|
||||||
date.getFullYear(),
|
date.getFullYear(),
|
||||||
'-',
|
'-',
|
||||||
date.getMonth() < 9 ? ('0' + (date.getMonth() + 1)) : (date.getMonth() + 1),
|
fmt.format(date.getMonth()),
|
||||||
'-',
|
|
||||||
date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate(),
|
|
||||||
'T',
|
'T',
|
||||||
date.getHours() < 10 ? ('0' + date.getHours()) : date.getHours(),
|
fmt.format(date.getHours()),
|
||||||
':',
|
':',
|
||||||
date.getMinutes() < 10 ? ('0' + date.getMinutes()) : date.getMinutes(),
|
fmt.format(date.getMinutes())
|
||||||
].join('')
|
].join('')
|
||||||
return datetime
|
return datetime
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue