修复筛选时间时的报错
This commit is contained in:
@@ -205,7 +205,7 @@ export default function BalancePage() {
|
||||
<div className="flex items-center gap-1">
|
||||
<span
|
||||
className={`font-semibold ${
|
||||
isPositive ? "text-green-600" : "text-red-600"
|
||||
isPositive ? "text-red-600" : "text-green-600"
|
||||
}`}
|
||||
>
|
||||
{isPositive ? "+" : ""}
|
||||
@@ -237,11 +237,15 @@ export default function BalancePage() {
|
||||
{
|
||||
header: "创建时间",
|
||||
accessorKey: "created_at",
|
||||
cell: ({ row }) =>
|
||||
format(
|
||||
new Date(row.original.created_at),
|
||||
"yyyy-MM-dd HH:mm:ss",
|
||||
),
|
||||
cell: ({ row }) => {
|
||||
const createdAt = row.original.created_at;
|
||||
if (!createdAt) return <span>-</span>;
|
||||
|
||||
const date = new Date(createdAt);
|
||||
if (isNaN(date.getTime())) return <span>-</span>;
|
||||
|
||||
return format(date, "yyyy-MM-dd HH:mm:ss");
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user