mirror of
https://github.com/ershisan99/db-studio.git
synced 2025-12-16 12:33:05 +00:00
adjust formating of numbers and dates to work with mysql
This commit is contained in:
@@ -100,7 +100,10 @@ export const DataTable = ({
|
|||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const value = row.getValue(column_name) as any;
|
const value = row.getValue(column_name) as any;
|
||||||
let finalValue = value;
|
let finalValue = value;
|
||||||
if (formatDates && udt_name === "timestamp") {
|
if (
|
||||||
|
formatDates &&
|
||||||
|
["timestamp", "datetime"].includes(udt_name.toLowerCase())
|
||||||
|
) {
|
||||||
finalValue = new Date(value as string).toLocaleString();
|
finalValue = new Date(value as string).toLocaleString();
|
||||||
}
|
}
|
||||||
if (showImagesPreview && typeof value === "string" && isUrl(value)) {
|
if (showImagesPreview && typeof value === "string" && isUrl(value)) {
|
||||||
@@ -129,7 +132,11 @@ export const DataTable = ({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn("break-all", data_type === "integer" && "text-right")}
|
className={cn(
|
||||||
|
"break-all",
|
||||||
|
["integer", "int", "tinyint", "double"].includes(data_type) &&
|
||||||
|
"text-right",
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{finalValue}
|
{finalValue}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user