mobilizon/js/src/plugins/dateFns.ts

15 lines
357 B
TypeScript
Raw Normal View History

import Vue from "vue";
import Locale from "date-fns";
declare module "vue/types/vue" {
interface Vue {
$dateFnsLocale: Locale;
}
}
export function DateFnsPlugin(vue: typeof Vue, { locale }: { locale: string }): void {
import(`date-fns/locale/${locale}/index.js`).then((localeEntity) => {
Vue.prototype.$dateFnsLocale = localeEntity;
});
}