fix: use String() instead of .toISOString() for errand timestamps
tRPC without superjson serializes Date objects as plain strings/numbers over the wire. The .toISOString() calls crashed because the values aren't Date instances on the client. Matches the existing pattern used elsewhere (e.g. agents page).
This commit is contained in:
@@ -331,8 +331,8 @@ export function ErrandDetailPanel({ errandId, onClose }: ErrandDetailPanelProps)
|
||||
{/* Info line */}
|
||||
<div className="px-5 pt-4 text-sm text-muted-foreground">
|
||||
{errand.status === 'merged'
|
||||
? `Merged into ${errand.baseBranch} · ${formatRelativeTime(errand.updatedAt.toISOString())}`
|
||||
: `Abandoned · ${formatRelativeTime(errand.updatedAt.toISOString())}`}
|
||||
? `Merged into ${errand.baseBranch} · ${formatRelativeTime(String(errand.updatedAt))}`
|
||||
: `Abandoned · ${formatRelativeTime(String(errand.updatedAt))}`}
|
||||
</div>
|
||||
|
||||
{/* Read-only diff */}
|
||||
|
||||
@@ -103,7 +103,7 @@ function ErrandsPage() {
|
||||
{e.agentAlias ?? '—'}
|
||||
</td>
|
||||
<td className="px-4 py-3 text-muted-foreground whitespace-nowrap">
|
||||
{formatRelativeTime(e.createdAt.toISOString())}
|
||||
{formatRelativeTime(String(e.createdAt))}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user