mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
18 lines
441 B
TypeScript
18 lines
441 B
TypeScript
![]() |
import format from 'date-fns/format';
|
||
|
import type { MRT_Cell, MRT_RowData } from 'material-react-table';
|
||
|
import { FC } from 'react';
|
||
|
|
||
|
import { useLocale } from 'hooks/useLocale';
|
||
|
|
||
|
interface CellProps {
|
||
|
cell: MRT_Cell<MRT_RowData>
|
||
|
}
|
||
|
|
||
|
const DateTimeCell: FC<CellProps> = ({ cell }) => {
|
||
|
const { dateFnsLocale } = useLocale();
|
||
|
|
||
|
return format(cell.getValue<Date>(), 'Pp', { locale: dateFnsLocale });
|
||
|
};
|
||
|
|
||
|
export default DateTimeCell;
|