2023-01-11 07:41:22 -05:00
|
|
|
import dayjs from 'dayjs'
|
2023-09-08 04:16:34 -04:00
|
|
|
import customParseFormat from 'dayjs/plugin/customParseFormat.js'
|
2024-04-09 09:45:17 -04:00
|
|
|
import LocalizedFormat from 'dayjs/plugin/localizedFormat.js'
|
2023-01-11 04:54:25 -05:00
|
|
|
import timezone from 'dayjs/plugin/timezone.js'
|
2023-09-08 04:16:34 -04:00
|
|
|
import utc from 'dayjs/plugin/utc.js'
|
2023-01-11 04:54:25 -05:00
|
|
|
|
2024-04-13 18:01:45 -04:00
|
|
|
import 'dayjs/locale/de'
|
|
|
|
import 'dayjs/locale/en'
|
|
|
|
import 'dayjs/locale/es'
|
2024-05-06 08:00:08 -04:00
|
|
|
import 'dayjs/locale/pt-br'
|
2024-04-13 18:01:45 -04:00
|
|
|
import 'dayjs/locale/ru'
|
2024-04-09 09:45:17 -04:00
|
|
|
|
2023-06-28 05:01:17 -04:00
|
|
|
declare module '#app' {
|
2023-09-08 04:16:34 -04:00
|
|
|
interface NuxtApp {
|
|
|
|
$dayjs(date?: dayjs.ConfigType): dayjs.Dayjs
|
|
|
|
}
|
2023-06-28 05:01:17 -04:00
|
|
|
}
|
|
|
|
declare module '@vue/runtime-core' {
|
2023-09-08 04:16:34 -04:00
|
|
|
interface ComponentCustomProperties {
|
|
|
|
$dayjs(date?: dayjs.ConfigType): dayjs.Dayjs
|
|
|
|
}
|
2023-06-28 05:01:17 -04:00
|
|
|
}
|
|
|
|
|
2023-01-11 04:54:25 -05:00
|
|
|
export default defineNuxtPlugin((nuxtApp) => {
|
2023-09-08 04:16:34 -04:00
|
|
|
dayjs.extend(customParseFormat)
|
2024-04-09 09:45:17 -04:00
|
|
|
dayjs.extend(LocalizedFormat)
|
2023-01-11 04:54:25 -05:00
|
|
|
dayjs.extend(timezone)
|
2023-09-08 04:16:34 -04:00
|
|
|
dayjs.extend(utc)
|
|
|
|
|
2023-01-11 04:54:25 -05:00
|
|
|
nuxtApp.provide('dayjs', dayjs)
|
|
|
|
})
|