[object Object]

← back to Dw Pitch Followup

pitch: 30-day already-emailed guard now shows date AND time (server + confirm dialog) — completes the date+time-on-all-emails pass

1ffa37a727ff811ec17a8890801b2f09a7bdcf5f · 2026-07-30 14:12:15 -0700 · steve

Files touched

Diff

commit 1ffa37a727ff811ec17a8890801b2f09a7bdcf5f
Author: steve <steve@designerwallcoverings.com>
Date:   Thu Jul 30 14:12:15 2026 -0700

    pitch: 30-day already-emailed guard now shows date AND time (server + confirm dialog) — completes the date+time-on-all-emails pass
---
 public/index.html | 2 +-
 server.js         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/public/index.html b/public/index.html
index 4bb156b..5df8d61 100644
--- a/public/index.html
+++ b/public/index.html
@@ -636,7 +636,7 @@ async function sendActive(btn){
     let res=await fetch(API('/api/send'),{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(payloadBase)});
     let j=await res.json();
     if(j.alreadySent){ // double-email guard tripped — let Steve override
-      btn.disabled=false; if(!confirm(`This client was already emailed ${new Date(j.lastSent).toLocaleDateString()} (within 30 days).\n\nSend AGAIN anyway?`)){ btn.textContent=old; stat.style.color='var(--amber)'; stat.textContent='skipped — already emailed recently'; return; }
+      btn.disabled=false; if(!confirm(`This client was already emailed ${fmtWhen(new Date(j.lastSent).toISOString())} (within 30 days).\n\nSend AGAIN anyway?`)){ btn.textContent=old; stat.style.color='var(--amber)'; stat.textContent='skipped — already emailed recently'; return; }
       btn.disabled=true; btn.textContent='sending…';
       res=await fetch(API('/api/send'),{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({...payloadBase,force:true})}); j=await res.json();
     }
diff --git a/server.js b/server.js
index d044aab..01d4f1f 100644
--- a/server.js
+++ b/server.js
@@ -648,7 +648,7 @@ app.post('/api/send', async (req, res) => {
         for (const l of fs.readFileSync(SENT_LOG, 'utf8').split('\n')) {
           if (!l.trim()) continue;
           try { const o = JSON.parse(l); if (String(o.to || '').toLowerCase() === toLC && Date.parse(o.ts) > cutoff) {
-            return res.status(409).json({ error: `already emailed ${new Date(o.ts).toLocaleDateString()} (within 30 days) — use “Send anyway” to override`, alreadySent: true, lastSent: o.ts });
+            return res.status(409).json({ error: `already emailed ${new Date(o.ts).toLocaleString(undefined, { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' })} (within 30 days) — use “Send anyway” to override`, alreadySent: true, lastSent: o.ts });
           } } catch { /* skip bad line */ }
         }
       }

← d3bd7eb pitch: ✓ emailed card chip now stamps date AND time (fmtWhen  ·  back to Dw Pitch Followup  ·  pitch: signpost 9768 (own listen port) vs 9850 (GEORGE clien 6330e75 →