Claude commited on
Commit
bd84d41
·
1 Parent(s): e063e1a

Fix timestamp timezone: treat backend UTC datetimes as UTC, display in browser local time

Browse files
frontend/src/components/HistoryPanel.tsx CHANGED
@@ -23,8 +23,8 @@ const statusColor = {
23
  }
24
 
25
  function formatDate(dt: string) {
26
- const d = new Date(dt)
27
- return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' })
28
  }
29
 
30
  export default function HistoryPanel({ runs, currentRunId, onSelect }: Props) {
 
23
  }
24
 
25
  function formatDate(dt: string) {
26
+ const utc = dt.endsWith('Z') || dt.includes('+') ? dt : dt + 'Z'
27
+ return new Date(utc).toLocaleString(undefined, { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' })
28
  }
29
 
30
  export default function HistoryPanel({ runs, currentRunId, onSelect }: Props) {
frontend/src/pages/Dashboard.tsx CHANGED
@@ -136,7 +136,9 @@ export default function Dashboard() {
136
 
137
  const formatRunTime = (dt: string | null) => {
138
  if (!dt) return ''
139
- return new Date(dt).toLocaleString('en-US', {
 
 
140
  weekday: 'short', month: 'short', day: 'numeric',
141
  hour: 'numeric', minute: '2-digit',
142
  })
 
136
 
137
  const formatRunTime = (dt: string | null) => {
138
  if (!dt) return ''
139
+ // Ensure UTC is interpreted correctly (backend returns naive ISO without Z)
140
+ const utc = dt.endsWith('Z') || dt.includes('+') ? dt : dt + 'Z'
141
+ return new Date(utc).toLocaleString(undefined, {
142
  weekday: 'short', month: 'short', day: 'numeric',
143
  hour: 'numeric', minute: '2-digit',
144
  })