fix: show real capture date in map popup (timestamp field + invalid-date guard)

map.js read capture.captured_at, but the backend stores the field as
`timestamp`, so every marker popup rendered "Invalid Date". Fall back to
timestamp and guard against unparseable values. Regenerated README popup
screenshot to reflect the fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
leetcrypt
2026-07-18 18:16:49 -07:00
parent 00eff8a347
commit 34b08c4ad6
3 changed files with 3 additions and 1 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

+3 -1
View File
@@ -182,7 +182,9 @@ function createMarker(capture) {
function createPopupContent(capture) { function createPopupContent(capture) {
const freqMHz = (capture.frequency / 1e6).toFixed(2); const freqMHz = (capture.frequency / 1e6).toFixed(2);
const date = new Date(capture.captured_at).toLocaleDateString(); const ts = capture.timestamp || capture.captured_at;
const parsed = ts ? new Date(ts) : null;
const date = parsed && !isNaN(parsed) ? parsed.toLocaleDateString() : 'Unknown';
let deviceInfo = 'Unknown Device'; let deviceInfo = 'Unknown Device';
if (capture.device_name) { if (capture.device_name) {