From d63948eba90d6327663d19fa573057c344af88f6 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 6 Nov 2023 17:59:31 +0530 Subject: [PATCH] refactor: move dayjs global changes to plugin to avoid unnecessary code repetition --- packages/nc-gui/plugins/a.dayjs.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/plugins/a.dayjs.ts b/packages/nc-gui/plugins/a.dayjs.ts index eecbf09832..ee2f7b3314 100644 --- a/packages/nc-gui/plugins/a.dayjs.ts +++ b/packages/nc-gui/plugins/a.dayjs.ts @@ -1,10 +1,11 @@ -import { extend } from 'dayjs' +import dayjs, { extend } from 'dayjs' import relativeTime from 'dayjs/plugin/relativeTime.js' import customParseFormat from 'dayjs/plugin/customParseFormat.js' import duration from 'dayjs/plugin/duration.js' import utc from 'dayjs/plugin/utc.js' import weekday from 'dayjs/plugin/weekday.js' import timezone from 'dayjs/plugin/timezone.js' +import updateLocale from 'dayjs/plugin/updateLocale' import { defineNuxtPlugin } from '#imports' export default defineNuxtPlugin(() => { @@ -14,4 +15,8 @@ export default defineNuxtPlugin(() => { extend(duration) extend(weekday) extend(timezone) + extend(updateLocale) + dayjs.updateLocale('en', { + weekStart: 1, + }) })