fix: apply parseUTC to dashboard, unify date helpers in date-utils.ts
Agent-Logs-Url: https://github.com/christianlouis/InboxConverge/sessions/3f06f1fc-4d21-47eb-b883-070c6cbefa93 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { useAuthStore } from '@/store/authStore';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useEffect } from 'react';
|
||||
import { adminApi, AdminProcessingRun } from '@/lib/api';
|
||||
import { parseUTC } from '@/lib/date-utils';
|
||||
import { formatDate, formatDuration } from '@/lib/date-utils';
|
||||
import {
|
||||
Activity,
|
||||
ChevronLeft,
|
||||
@@ -25,19 +25,6 @@ const STATUS_STYLES: Record<string, string> = {
|
||||
running: 'bg-blue-100 text-blue-800',
|
||||
};
|
||||
|
||||
function formatDuration(seconds?: number | null): string {
|
||||
if (seconds == null) return '—';
|
||||
if (seconds < 60) return `${seconds.toFixed(1)}s`;
|
||||
return `${Math.floor(seconds / 60)}m ${Math.round(seconds % 60)}s`;
|
||||
}
|
||||
|
||||
function formatDate(iso: string): string {
|
||||
return parseUTC(iso).toLocaleString(undefined, {
|
||||
dateStyle: 'short',
|
||||
timeStyle: 'medium',
|
||||
});
|
||||
}
|
||||
|
||||
export default function AdminLogsPage() {
|
||||
const { user } = useAuthStore();
|
||||
const router = useRouter();
|
||||
|
||||
Reference in New Issue
Block a user