diff --git a/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx index ab5213db2..6bd2275fc 100644 --- a/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx @@ -1,7 +1,7 @@ "use client"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { format } from "date-fns"; +import { formatThreadTimestamp } from "@/lib/format-date"; import { useSetAtom } from "jotai"; import { ArchiveIcon, @@ -390,7 +390,7 @@ export function AllPrivateChatsSidebarContent({

{t("updated") || "Updated"}:{" "} - {format(new Date(thread.updatedAt), "MMM d, yyyy 'at' h:mm a")} + {formatThreadTimestamp(thread.updatedAt)}

diff --git a/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx index ab1072459..81d173f36 100644 --- a/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx @@ -1,7 +1,7 @@ "use client"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { format } from "date-fns"; +import { formatThreadTimestamp } from "@/lib/format-date"; import { useSetAtom } from "jotai"; import { ArchiveIcon, @@ -389,7 +389,7 @@ export function AllSharedChatsSidebarContent({

{t("updated") || "Updated"}:{" "} - {format(new Date(thread.updatedAt), "MMM d, yyyy 'at' h:mm a")} + {formatThreadTimestamp(thread.updatedAt)}

diff --git a/surfsense_web/lib/format-date.ts b/surfsense_web/lib/format-date.ts index ee60d113d..9decd3402 100644 --- a/surfsense_web/lib/format-date.ts +++ b/surfsense_web/lib/format-date.ts @@ -22,3 +22,11 @@ export function formatRelativeDate(dateString: string): string { if (daysAgo < 7) return `${daysAgo}d ago`; return format(date, "MMM d, yyyy"); } + +/** + * Format a thread's last-updated timestamp for the chats sidebars. + * Example: "Mar 23, 2026 at 4:30 PM" + */ +export function formatThreadTimestamp(dateString: string): string { + return format(new Date(dateString), "MMM d, yyyy 'at' h:mm a"); +}