@@ -4,6 +4,7 @@ import { MUIDataTableColumn } from 'mui-datatables';
44import { useCallback , useMemo , useRef } from 'react' ;
55import { PublishIcon } from '../../icons' ;
66import { CHARCOAL } from '../../theme' ;
7+ import { FormattedTime } from '../../utils' ;
78import { Pattern } from '../CustomCatalog/CustomCard' ;
89import { ErrorBoundary } from '../ErrorBoundary' ;
910import { ColView } from '../Helpers/ResponsiveColumns/responsive-coulmns.tsx/responsive-column' ;
@@ -56,16 +57,6 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
5657} ) => {
5758 const modalRef = useRef < PromptRef > ( null ) ;
5859
59- const formatDate = useCallback ( ( date : string | Date ) : string => {
60- const dateOptions : Intl . DateTimeFormatOptions = {
61- weekday : 'short' ,
62- day : 'numeric' ,
63- month : 'long' ,
64- year : 'numeric'
65- } ;
66- return new Date ( date ) . toLocaleDateString ( 'en-US' , dateOptions ) ;
67- } , [ ] ) ;
68-
6960 const processedColumns : MUIDataTableColumn [ ] = useMemo ( ( ) => {
7061 return columns . map ( ( col ) => {
7162 const newCol = { ...col } ;
@@ -86,16 +77,16 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
8677 if ( ! value || value === 'NA' ) return < > NA</ > ;
8778 if ( typeof value === 'object' && 'Valid' in value ) {
8879 if ( value . Valid && value . Time ) {
89- return < > { formatDate ( value . Time ) } < /> ;
80+ return < FormattedTime date = { value . Time } /> ;
9081 }
9182 return < > NA</ > ;
9283 }
93- return < > { formatDate ( value ) } < /> ;
84+ return < FormattedTime date = { value . Time } /> ;
9485 } ;
9586 }
9687 return newCol ;
9788 } ) ;
98- } , [ columns , columnVisibility , formatDate ] ) ;
89+ } , [ columns , columnVisibility ] ) ;
9990
10091 const handleTableChange = useCallback (
10192 ( action : string , tableState : any ) => {
0 commit comments