18 lines
428 B
TypeScript
18 lines
428 B
TypeScript
import dayjs from 'dayjs';
|
|
import relativeTime from 'dayjs/plugin/relativeTime.js';
|
|
import 'dayjs/locale/ko';
|
|
|
|
dayjs.locale('ko');
|
|
dayjs.extend(relativeTime);
|
|
|
|
export default defineNuxtPlugin((/* nuxtApp */) => {
|
|
// _utils.log('defineNuxtPlugin() of dayjs.ts executed...');
|
|
return {
|
|
provide: {
|
|
dayjs: (rawDateTime) => {
|
|
return dayjs(rawDateTime);
|
|
},
|
|
},
|
|
};
|
|
});
|