Format date display in perf dashboard (Jan 29, 2026 8:46 PM)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bc88f28e60
commit
cf1c6497ca
1 changed files with 7 additions and 1 deletions
|
|
@ -129,6 +129,12 @@ let refreshTimer = null;
|
||||||
|
|
||||||
function qs(s) { return document.querySelector(s); }
|
function qs(s) { return document.querySelector(s); }
|
||||||
function fmt(n) { return n == null ? '-' : Number(n).toLocaleString(); }
|
function fmt(n) { return n == null ? '-' : Number(n).toLocaleString(); }
|
||||||
|
function fmtDate(s) {
|
||||||
|
if (!s || s === 'none') return 'none';
|
||||||
|
var d = new Date(s.replace(' ', 'T'));
|
||||||
|
if (isNaN(d)) return s;
|
||||||
|
return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) + ' ' + d.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true });
|
||||||
|
}
|
||||||
function fmtMs(n) {
|
function fmtMs(n) {
|
||||||
if (n == null) return '-';
|
if (n == null) return '-';
|
||||||
n = Number(n);
|
n = Number(n);
|
||||||
|
|
@ -191,7 +197,7 @@ async function loadAll() {
|
||||||
card('Avg DB Time', s.OverallAvgDbMs || 0, 'ms') +
|
card('Avg DB Time', s.OverallAvgDbMs || 0, 'ms') +
|
||||||
card('Avg App Time', s.OverallAvgAppMs || 0, 'ms') +
|
card('Avg App Time', s.OverallAvgAppMs || 0, 'ms') +
|
||||||
card('Avg Queries', s.OverallAvgQueries || 0, '/req') +
|
card('Avg Queries', s.OverallAvgQueries || 0, '/req') +
|
||||||
card('Data Since', s.FirstLog || 'none', '');
|
card('Data Since', fmtDate(s.FirstLog), '');
|
||||||
qs('#summarySection').style.display = '';
|
qs('#summarySection').style.display = '';
|
||||||
|
|
||||||
// Count table
|
// Count table
|
||||||
|
|
|
||||||
Reference in a new issue