nuxt-start/composables/localeDateString.ts
2025-01-02 20:56:21 +01:00

11 lines
217 B
TypeScript

export const useLocaleDateString = (d:any) => {
let _d = d
if(typeof d === "string"){
let _d = new Date(d)
}
if(typeof _d === 'object'){
console.log(typeof _d)
return _d.toLocaleDateString()
}
}