← back to Rentv
harden(deals-admin): Cody gate — every card now shows a created chip (was 1.1%→100%): corpus rows use the article date as created_at (date-only, no fabricated time), feed deals keep the real first_seen timestamp; fmtDateTime local-parses date-only to avoid the UTC-midnight off-by-one
5de160cc97f5635f370ea9bbff1a105dd31f81ab · 2026-08-06 08:27:04 -0700 · Steve
Files touched
M public/deals.htmlM server.js
Diff
commit 5de160cc97f5635f370ea9bbff1a105dd31f81ab
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Aug 6 08:27:04 2026 -0700
harden(deals-admin): Cody gate — every card now shows a created chip (was 1.1%→100%): corpus rows use the article date as created_at (date-only, no fabricated time), feed deals keep the real first_seen timestamp; fmtDateTime local-parses date-only to avoid the UTC-midnight off-by-one
---
public/deals.html | 10 ++++++++--
server.js | 4 ++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/public/deals.html b/public/deals.html
index fc824ced..c28f32d2 100644
--- a/public/deals.html
+++ b/public/deals.html
@@ -214,8 +214,14 @@ function dateOf(d){
const m=String(d.image||'').match(/([A-Z][a-z]+?)(\d{1,2})(\d{4})\.(?:jpg|jpeg|png|webp)/);if(!m)return null;const mo=MONTHS[m[1].slice(0,3)];if(mo==null)return null;return new Date(Date.UTC(+m[3],mo,+m[2]));
}
const fmtDate=dt=>dt?dt.toLocaleDateString(undefined,{month:'short',day:'numeric',year:'numeric'}):'';
-// Admin-card rule: show the RECORD's created date AND time (when RENTV first captured it) in local tz.
-const fmtDateTime=iso=>{if(!iso)return'';const dt=new Date(iso);return isNaN(dt)?'':dt.toLocaleString(undefined,{month:'short',day:'numeric',year:'numeric',hour:'numeric',minute:'2-digit'});};
+// Admin-card rule: show the RECORD's created date AND time in local tz. A full ISO timestamp (feed
+// deals, from the registry first_seen) renders date+time; a DATE-ONLY value (corpus article date) renders
+// date-only — parsed as a LOCAL date so a UTC-midnight string doesn't render as the prior evening, and
+// with no fabricated clock so we never show a precision we don't actually have.
+const fmtDateTime=v=>{if(!v)return'';const s=String(v);
+ const md=s.match(/^(\d{4})-(\d{2})-(\d{2})$/);
+ if(md)return new Date(+md[1],+md[2]-1,+md[3]).toLocaleDateString(undefined,{month:'short',day:'numeric',year:'numeric'});
+ const dt=new Date(s);return isNaN(dt)?'':dt.toLocaleString(undefined,{month:'short',day:'numeric',year:'numeric',hour:'numeric',minute:'2-digit'});};
const isManual=d=>d._manual||String(d.id||'').startsWith('md');
function pillRow(hostId,list,cur,pick){
diff --git a/server.js b/server.js
index 0baf851a..963254ac 100644
--- a/server.js
+++ b/server.js
@@ -537,6 +537,10 @@ function corpusDeals() {
amount: a.amount || null, amount_label: (isSale && amt > 0 && amt < 1_000_000) ? '' : (a.amount_label || ''),
size_label: a.size_label || '', units: a.units || null, sqft: a.sqft || null,
address: null, close_date: a.date || '', year_built: null,
+ // Corpus articles aren't in the deal registry (no first_seen), so use the article's own date as
+ // the record's captured-on proxy — DATE-ONLY (no fabricated time); the chip renders it without a
+ // clock so we never invent a precision we don't have. Feed deals still get the real first_seen ts.
+ created_at: a.date || null,
buyer: a.buyer || '', seller: a.seller || '', broker: a.broker || '', summary: a.summary || '',
};
});
← 939f491c Build missing topic.html + topics.html — fix broken /topic/*
·
back to Rentv
·
feat(closings-admin): sibling-drift fix — mirror the created 6033166b →