diff --git a/web/app/components/datasets/list/dataset-card/index.tsx b/web/app/components/datasets/list/dataset-card/index.tsx index 5ebf008ecd..15604c4d89 100644 --- a/web/app/components/datasets/list/dataset-card/index.tsx +++ b/web/app/components/datasets/list/dataset-card/index.tsx @@ -13,6 +13,7 @@ import { RiFileTextFill, RiMoreFill, RiRobot2Fill } from '@remixicon/react' import Tooltip from '@/app/components/base/tooltip' import { useGetLanguage } from '@/context/i18n' import dayjs from 'dayjs' +import relativeTime from 'dayjs/plugin/relativeTime' import { checkIsUsedInApp, deleteDataset } from '@/service/datasets' import RenameDatasetModal from '../../rename-modal' import Confirm from '@/app/components/base/confirm' @@ -23,6 +24,7 @@ import AppIcon from '@/app/components/base/app-icon' import CornerLabel from '@/app/components/base/corner-label' import { DOC_FORM_ICON_WITH_BG, DOC_FORM_TEXT } from '@/models/datasets' import { useExportPipelineDSL } from '@/service/use-pipeline' +dayjs.extend(relativeTime) const EXTERNAL_PROVIDER = 'external' diff --git a/web/app/components/tools/mcp/hooks.ts b/web/app/components/tools/mcp/hooks.ts index b2b521557f..4a348569a0 100644 --- a/web/app/components/tools/mcp/hooks.ts +++ b/web/app/components/tools/mcp/hooks.ts @@ -1,6 +1,8 @@ import dayjs from 'dayjs' +import relativeTime from 'dayjs/plugin/relativeTime' import { useCallback } from 'react' import { useI18N } from '@/context/i18n' +dayjs.extend(relativeTime) export const useFormatTimeFromNow = () => { const { locale } = useI18N() diff --git a/web/app/components/workflow/hooks/use-format-time-from-now.ts b/web/app/components/workflow/hooks/use-format-time-from-now.ts index b2b521557f..4a348569a0 100644 --- a/web/app/components/workflow/hooks/use-format-time-from-now.ts +++ b/web/app/components/workflow/hooks/use-format-time-from-now.ts @@ -1,6 +1,8 @@ import dayjs from 'dayjs' +import relativeTime from 'dayjs/plugin/relativeTime' import { useCallback } from 'react' import { useI18N } from '@/context/i18n' +dayjs.extend(relativeTime) export const useFormatTimeFromNow = () => { const { locale } = useI18N()