diff --git a/src/client/components/server/ServerList.tsx b/src/client/components/server/ServerList.tsx index 194310e..7a922fe 100644 --- a/src/client/components/server/ServerList.tsx +++ b/src/client/components/server/ServerList.tsx @@ -136,7 +136,7 @@ export const ServerList: React.FC = React.memo((props) => { columnHelper.accessor('updatedAt', { header: t('updatedAt'), size: 130, - cell: (props) => dayjs(props.getValue()).format('MMM D HH:mm:ss'), + cell: (props) => dayjs(props.getValue()).fromNow(), }), ]; }, [t]); diff --git a/src/client/utils/date.ts b/src/client/utils/date.ts index a10777d..d24f945 100644 --- a/src/client/utils/date.ts +++ b/src/client/utils/date.ts @@ -1,11 +1,13 @@ import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import timezone from 'dayjs/plugin/timezone'; +import relativeTime from 'dayjs/plugin/relativeTime'; import advancedFormat from 'dayjs/plugin/advancedFormat'; import type { DateUnit } from '@tianji/shared'; dayjs.extend(utc); dayjs.extend(timezone); +dayjs.extend(relativeTime); dayjs.extend(advancedFormat); export type { DateUnit };