From 6bf181525c8de1a87b369f039ee014e28f47b3f7 Mon Sep 17 00:00:00 2001 From: andres Date: Thu, 11 Jul 2024 14:06:03 +0200 Subject: [PATCH] adjust formating of numbers and dates to work with mysql --- frontend/src/components/db-table-view/data-table.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/db-table-view/data-table.tsx b/frontend/src/components/db-table-view/data-table.tsx index 5afc190..9421b9d 100644 --- a/frontend/src/components/db-table-view/data-table.tsx +++ b/frontend/src/components/db-table-view/data-table.tsx @@ -100,7 +100,10 @@ export const DataTable = ({ cell: ({ row }) => { const value = row.getValue(column_name) as any; let finalValue = value; - if (formatDates && udt_name === "timestamp") { + if ( + formatDates && + ["timestamp", "datetime"].includes(udt_name.toLowerCase()) + ) { finalValue = new Date(value as string).toLocaleString(); } if (showImagesPreview && typeof value === "string" && isUrl(value)) { @@ -129,7 +132,11 @@ export const DataTable = ({ } return (
{finalValue}