diff --git a/packages/core/client/src/nocobase-buildin-plugin/plugins/LocalePlugin.ts b/packages/core/client/src/nocobase-buildin-plugin/plugins/LocalePlugin.ts index 2c276a4ba..d356a86d3 100644 --- a/packages/core/client/src/nocobase-buildin-plugin/plugins/LocalePlugin.ts +++ b/packages/core/client/src/nocobase-buildin-plugin/plugins/LocalePlugin.ts @@ -36,6 +36,13 @@ export class LocalePlugin extends Plugin { const dayjsLang = dayjsLocale[data?.data?.lang] || 'en'; await import(`dayjs/locale/${dayjsLang}`); dayjs.locale(dayjsLang); + + // 防止数据源没有日期值的时候, 界面显示 Invalid Date + const updateLocale = await import('dayjs/plugin/updateLocale'); + dayjs.extend(updateLocale.default); + const localeSetting = { invalidDate: '-' }; + dayjs.updateLocale(dayjsLang, localeSetting); + window['cronLocale'] = data?.data?.cron; } catch (error) { (() => {})();