Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: reuse canonical future time formatter (#4889)

Adam Eivyb7155a29315c
diff --git a/client/src/components/cos/tabs/JobsTab.jsx b/client/src/components/cos/tabs/JobsTab.jsx
index 2cd9d1484f..bd75fd6a7b 100644
--- a/client/src/components/cos/tabs/JobsTab.jsx
+++ b/client/src/components/cos/tabs/JobsTab.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback } from 'react';
import { Plus, RefreshCw, Play, Trash2, ChevronDown, ChevronUp, Clock, ToggleLeft, ToggleRight, Edit3, Save, X, Terminal } from 'lucide-react';
import toast from '../../ui/Toast';
import * as api from '../../../services/api';
-import { timeAgo, formatDateTime, formatDateNumeric } from '../../../utils/formatters';
+import { timeAgo, timeUntil, formatDateTime, formatDateNumeric } from '../../../utils/formatters';
import { CRON_PRESETS, DEFAULT_CRON, describeCron, JOB_INTERVAL_OPTIONS as INTERVAL_OPTIONS } from '../../../utils/cronHelpers';
import WeekdayTimePicker from '../../WeekdayTimePicker';
import { effectiveModelFor, effortAwareModelOptions } from '../../../utils/providers';
@@ -275,14 +275,7 @@ function formatNextDue(job) {
nextDate.setHours(hours, minutes, 0, 0);
if (nextDate.getTime() > nextDue) nextDue = nextDate.getTime();
}
- const diff = nextDue - Date.now();
- if (diff <= 0) return 'Now';
- const hrs = Math.floor(diff / 3600000);
- const days = Math.floor(hrs / 24);
- if (days > 0) return `in ${days}d`;
- if (hrs > 0) return `in ${hrs}h`;
- const mins = Math.floor(diff / 60000);
- return `in ${mins}m`;
+ return timeUntil(nextDue, 'Now');
}
function getJobTypeLabel(job) {