← back to Rentv
Cody-gate fixes: harden PR.date with isNaN guard (was rendering 'Invalid Date' for bad values, app-wide); org 'Added' column reuses the robust adminDt helper (ISO title + guards)
80087c0b6f20c7936ae8fecee45bf95a1d4d7cb5 · 2026-08-05 14:24:38 -0700 · Steve Abrams
Files touched
M public/admin/pr-intelligence/organizations.htmlM public/admin/pr-intelligence/pr-shared.js
Diff
commit 80087c0b6f20c7936ae8fecee45bf95a1d4d7cb5
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Aug 5 14:24:38 2026 -0700
Cody-gate fixes: harden PR.date with isNaN guard (was rendering 'Invalid Date' for bad values, app-wide); org 'Added' column reuses the robust adminDt helper (ISO title + guards)
---
public/admin/pr-intelligence/organizations.html | 2 +-
public/admin/pr-intelligence/pr-shared.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/admin/pr-intelligence/organizations.html b/public/admin/pr-intelligence/organizations.html
index cb2d10d9..94929880 100644
--- a/public/admin/pr-intelligence/organizations.html
+++ b/public/admin/pr-intelligence/organizations.html
@@ -251,7 +251,7 @@
{ key: 'priority', label: 'Priority', render: (r) => PR.score(r.priority_score) },
{ key: 'status', label: 'Status', render: (r) => PR.statusBadge(r.lifecycle_status) },
{ key: 'verified', label: 'Verified', render: (r) => PR.dateShort(r.last_verified_at) },
- { key: 'created', label: 'Added', render: (r) => `<span title="${PR.esc(r.created_at || '')}">🕓 ${PR.date(r.created_at)}</span>` },
+ { key: 'created', label: 'Added', render: (r) => adminDt(r.created_at) },
];
// ── Expand renderer (inline detail strip) ───────────────────────────────────
diff --git a/public/admin/pr-intelligence/pr-shared.js b/public/admin/pr-intelligence/pr-shared.js
index 6e291e2b..6efcd9d0 100644
--- a/public/admin/pr-intelligence/pr-shared.js
+++ b/public/admin/pr-intelligence/pr-shared.js
@@ -87,7 +87,7 @@
// ── Utilities ────────────────────────────────────────────────────────────
esc(s) { return String(s == null ? '' : s).replace(/[<>&"]/g, (c) => ({ '<': '<', '>': '>', '&': '&', '"': '"' }[c])); },
- date(s) { return s ? new Date(s).toLocaleString(undefined, { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : '—'; },
+ date(s) { if (!s) return '—'; const d = new Date(s); return isNaN(d) ? '—' : d.toLocaleString(undefined, { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }); },
dateShort(s) { return s ? new Date(s).toLocaleDateString(undefined, { year: '2-digit', month: 'short', day: 'numeric' }) : '—'; },
toast(msg, err) {
const t = document.getElementById('toast');
← 74c3fba9 People + Organizations lists: add sortable 'Added' column (c
·
back to Rentv
·
security: /api/posts + /api/posts/:id never serve DRAFTS to 548ec200 →