mirror of https://github.com/Nezreka/SoulSync.git
Recent activity items on the dashboard all rendered 'NaNmo ago' because the formatter parsed `activity.time` (a human label like 'Now' / 'Just now') with `new Date(...)` -> Invalid Date -> NaN arithmetic -> 'NaNmo ago'. Backend (`core/runtime_state.add_activity_item`) has always emitted `activity.timestamp` (Unix epoch seconds) alongside the label. Frontend now uses the epoch for relative-time formatting via a new local `_activityTimeAgo` helper: - typeof timestamp === 'number' -> diff against Date.now() in ms - < 60s -> 'Just now' - < 60m -> 'Nm ago' - < 24h -> 'Nh ago' - < 30d -> 'Nd ago' - otherwise 'Nmo ago' - falls back to the literal `activity.time` label only when no timestamp is present (legacy items / future shapes) Both call sites in api-monitor.js (initial render + timestamp-only refresh path) updated to the new helper.pull/529/head
parent
81af852f61
commit
19a18ba992
Loading…
Reference in new issue