strette di mano
This commit is contained in:
41
src/components/CTimeAgo/CTimeAgo.ts
Executable file
41
src/components/CTimeAgo/CTimeAgo.ts
Executable file
@@ -0,0 +1,41 @@
|
||||
import { defineComponent, ref, computed, PropType, toRef, onMounted } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
import { es, it, enUS } from 'date-fns/locale' // import custom locale
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CTimeAgo',
|
||||
components: {},
|
||||
props: {
|
||||
datetime: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
const mylocale = ref(<any>null)
|
||||
|
||||
function mounted() {
|
||||
mylocale.value = enUS
|
||||
if (toolsext.getLocale() === 'it')
|
||||
mylocale.value = it
|
||||
else if (toolsext.getLocale() === 'es')
|
||||
mylocale.value = es
|
||||
}
|
||||
|
||||
mounted()
|
||||
|
||||
return {
|
||||
tools,
|
||||
toolsext,
|
||||
mylocale,
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user