From 15bb07d1fb9192b07f6e07fdc254e79ced9be36f Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Wed, 6 May 2026 15:12:08 -0700 Subject: [PATCH] fix(ui/agents): swap AgentList to typed dayjs helper Optional-chaining dayjs(...).fromNow?.() was a TS error because the relativeTime plugin wasn't loaded. Use relativeOrAbsolute() from the shared helper instead. --- .../src/app/(dashboard)/agents/components/agent-list.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/agents/components/agent-list.tsx b/ui/litellm-dashboard/src/app/(dashboard)/agents/components/agent-list.tsx index fa37bd630f2..18146dde185 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/agents/components/agent-list.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/agents/components/agent-list.tsx @@ -3,7 +3,7 @@ import Link from "next/link"; import { Card, Table, Tag, Typography, Empty } from "antd"; import type { ColumnsType } from "antd/es/table"; -import dayjs from "dayjs"; +import { relativeOrAbsolute } from "@/app/(dashboard)/agents/components/_dayjs"; import type { CloudAgent } from "@/types/cloud-agents"; const { Text } = Typography; @@ -41,8 +41,7 @@ export default function AgentList({ agents, loading }: AgentListProps) { title: "Last activity", dataIndex: "last_activity_at", key: "last_activity_at", - render: (value: string | null) => - value ? dayjs(value).fromNow?.() ?? dayjs(value).format("YYYY-MM-DD HH:mm") : "—", + render: (value: string | null) => relativeOrAbsolute(value), }, ];