mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
14 lines
No EOL
483 B
TypeScript
14 lines
No EOL
483 B
TypeScript
export default defineNuxtPlugin((nuxtApp) => {
|
|
const formatter = {
|
|
time (unixTimestamp: number) {
|
|
console.error(unixTimestamp)
|
|
if (!unixTimestamp) return 'no'
|
|
return new Date(unixTimestamp*1000).toLocaleString()
|
|
},
|
|
timeToISO (unixTimestamp: number) {
|
|
if (!unixTimestamp) return 'no'
|
|
return new Date(unixTimestamp*1000).toISOString()
|
|
}
|
|
}
|
|
nuxtApp.provide('formatter', formatter)
|
|
}) |