We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63ac02b commit eab661eCopy full SHA for eab661e
gui/src/components/BackgroundMode/AgentsList.tsx
@@ -295,8 +295,15 @@ function AgentStatusBadge({ status }: { status: string }) {
295
function formatRelativeTime(dateString: string): string {
296
try {
297
const date = new Date(dateString);
298
+ const timestamp = date.getTime();
299
+
300
+ // Guard against invalid dates (NaN)
301
+ if (isNaN(timestamp)) {
302
+ return dateString;
303
+ }
304
305
const now = new Date();
- const diffMs = now.getTime() - date.getTime();
306
+ const diffMs = now.getTime() - timestamp;
307
const diffMins = Math.floor(diffMs / 60000);
308
const diffHours = Math.floor(diffMs / 3600000);
309
const diffDays = Math.floor(diffMs / 86400000);
0 commit comments