Skip to content

Commit fb68d19

Browse files
committed
Add modification date to table list page
1 parent e916701 commit fb68d19

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/pages/Tables.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ interface TablesResultsProps {
8686
loading?: boolean;
8787
}
8888

89+
function formatModificationDate(isoString: string): string {
90+
const d = new Date(isoString);
91+
return d
92+
.toLocaleDateString("en-US", {
93+
month: "short",
94+
day: "2-digit",
95+
year: "numeric",
96+
})
97+
.replace(",", "");
98+
}
99+
89100
function TablesResults({ data, loading }: TablesResultsProps): ReactElement {
90101
const columns: Column[] = [
91102
{
@@ -100,6 +111,7 @@ function TablesResults({ data, loading }: TablesResultsProps): ReactElement {
100111
{ name: "Description" },
101112
{ name: "Number of records" },
102113
{ name: "Number of columns" },
114+
{ name: "Modification date" },
103115
];
104116

105117
const tableData: Record<string, CellPrimitive>[] =
@@ -108,6 +120,9 @@ function TablesResults({ data, loading }: TablesResultsProps): ReactElement {
108120
Description: table.description,
109121
"Number of records": table.num_entries,
110122
"Number of columns": table.num_fields,
123+
"Modification date": table.modification_dt
124+
? formatModificationDate(table.modification_dt)
125+
: "—",
111126
})) ?? [];
112127

113128
return <CommonTable columns={columns} data={tableData} loading={loading} />;

0 commit comments

Comments
 (0)