fix(tools): keep results when a timestamp is outside Date's range (#1045)

isoTime returned toISOString() for any finite number, which throws past ±8.64e15 ms, so one bad record (e.g. a bike-share last_reported) failed the whole tool answer. Such timestamps are now null. The voice analyst's result rows had the same conversion and get the same guard.

Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
Rudy Mizrahi CelekliandSameh Khamis authored and GitHub committed 2026-10-14 19:54:17 -07:00
1 parent 84bfba8d39
commit fd5a1ef856
6 files changed
+89 -3

No files matched your search

+3 -1
View File
@@ -24,7 +24,9 @@ export function capRows(rows, limit = DEFAULT_LIMIT) {
/** Format an epoch millisecond time as ISO 8601, or null. */
export function isoTime(ms) {
return Number.isFinite(ms) ? new Date(ms).toISOString() : null;
if (!Number.isFinite(ms)) return null;
const date = new Date(ms);
return Number.isFinite(date.getTime()) ? date.toISOString() : null;
}
/** "1 earthquake", "3 earthquakes". */