From ea09a86d0505b08f38e70be0c8717df414144a75 Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Sat, 6 Jun 2026 00:42:08 +0200 Subject: [PATCH] fix(crm): recent-activity email placeholder + customer-dashboard locale dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Recent Activity rendered literal {{email}} — the per-row t() call didn't pass the email interpolation var. Source it like formatActivityMessage (metadata.email ?? actorName). - Customer 'Deine Galerien' dates rendered en-US ('May','Jun') under a German UI because they used raw date-fns format(parseISO(iso),'PP') with no locale. Route through useLocalizedDate().format → honours general_date_format + the active language. --- frontend/src/pages/admin/AdminDashboard.tsx | 5 +++++ frontend/src/pages/customer/CustomerDashboardPage.tsx | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/admin/AdminDashboard.tsx b/frontend/src/pages/admin/AdminDashboard.tsx index 6f6c749f..4fd0ee0f 100644 --- a/frontend/src/pages/admin/AdminDashboard.tsx +++ b/frontend/src/pages/admin/AdminDashboard.tsx @@ -276,6 +276,11 @@ export const AdminDashboard: React.FC = () => { const getActivityMessage = (): string => { const params: Record = { eventName: activity.eventName || t('common.unknown'), + // Customer/account activity keys (customer_login, + // customer_invitation_*, customer_updated, …) interpolate + // {{email}}; without it the literal placeholder rendered. + // Sourced the same way formatActivityMessage does. + email: activity.metadata?.email || activity.actorName || '', count: activity.metadata?.count || 0, template: activity.metadata?.template_key || '', categoryName: activity.metadata?.category_name || '' diff --git a/frontend/src/pages/customer/CustomerDashboardPage.tsx b/frontend/src/pages/customer/CustomerDashboardPage.tsx index e9e5c152..b94711f3 100644 --- a/frontend/src/pages/customer/CustomerDashboardPage.tsx +++ b/frontend/src/pages/customer/CustomerDashboardPage.tsx @@ -25,7 +25,7 @@ import { useNavigate } from 'react-router-dom'; import { Calendar, Clock, Download, ExternalLink, ImageIcon, AlertCircle } from 'lucide-react'; import { toast } from 'react-toastify'; import { useTranslation } from 'react-i18next'; -import { format, parseISO } from 'date-fns'; +import { useLocalizedDate } from '../../hooks/useLocalizedDate'; import { useQuery } from '@tanstack/react-query'; import { Button, Loading } from '../../components/common'; @@ -51,6 +51,10 @@ const DEFAULT_SORT: SortKey = 'newest'; export const CustomerDashboardPage: React.FC = () => { const { t } = useTranslation(); const navigate = useNavigate(); + // Localized date formatting — respects general_date_format + the active UI + // language. Previously used raw date-fns `format(parseISO(iso),'PP')` with + // no locale, so dates rendered en-US ("May", "Jun") under a German UI. + const { format: fmtLocalized } = useLocalizedDate(); const { data: events, isLoading, error } = useQuery({ queryKey: ['customer-events'], @@ -125,7 +129,7 @@ export const CustomerDashboardPage: React.FC = () => { const formatDate = (iso: string | null) => { if (!iso) return null; - try { return format(parseISO(iso), 'PP'); } catch { return null; } + try { return fmtLocalized(iso); } catch { return null; } }; return (