refactor: improve server list update at display
This commit is contained in:
parent
7cfafe49d7
commit
51675f6129
@ -136,7 +136,7 @@ export const ServerList: React.FC<ServerListProps> = React.memo((props) => {
|
|||||||
columnHelper.accessor('updatedAt', {
|
columnHelper.accessor('updatedAt', {
|
||||||
header: t('updatedAt'),
|
header: t('updatedAt'),
|
||||||
size: 130,
|
size: 130,
|
||||||
cell: (props) => dayjs(props.getValue()).format('MMM D HH:mm:ss'),
|
cell: (props) => dayjs(props.getValue()).fromNow(),
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
}, [t]);
|
}, [t]);
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import utc from 'dayjs/plugin/utc';
|
import utc from 'dayjs/plugin/utc';
|
||||||
import timezone from 'dayjs/plugin/timezone';
|
import timezone from 'dayjs/plugin/timezone';
|
||||||
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
import advancedFormat from 'dayjs/plugin/advancedFormat';
|
import advancedFormat from 'dayjs/plugin/advancedFormat';
|
||||||
import type { DateUnit } from '@tianji/shared';
|
import type { DateUnit } from '@tianji/shared';
|
||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
dayjs.extend(timezone);
|
dayjs.extend(timezone);
|
||||||
|
dayjs.extend(relativeTime);
|
||||||
dayjs.extend(advancedFormat);
|
dayjs.extend(advancedFormat);
|
||||||
|
|
||||||
export type { DateUnit };
|
export type { DateUnit };
|
||||||
|
Loading…
Reference in New Issue
Block a user