mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
27 lines
605 B
TypeScript
27 lines
605 B
TypeScript
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
import dayjs from 'dayjs';
|
|
import { PageMeta } from '@/providers/editor-provider';
|
|
import { TableCell } from '@/ui/table';
|
|
import React from 'react';
|
|
|
|
dayjs.extend(localizedFormat);
|
|
|
|
export const DateCell = ({
|
|
pageMeta,
|
|
dateKey,
|
|
}: {
|
|
pageMeta: PageMeta;
|
|
dateKey: keyof PageMeta;
|
|
}) => {
|
|
// dayjs().format('L LT');
|
|
return (
|
|
<TableCell ellipsis={true}>
|
|
{pageMeta[dateKey] === undefined
|
|
? '--'
|
|
: dayjs(pageMeta[dateKey] as string).format('YYYY-MM-DD HH:mm')}
|
|
</TableCell>
|
|
);
|
|
};
|
|
|
|
export default DateCell;
|