From 03371ecd8025c066a147b28f57ad4abf1005ee0e Mon Sep 17 00:00:00 2001 From: James Date: Sat, 21 Feb 2026 00:01:21 -0500 Subject: [PATCH] chore: auto-commit uncommitted changes --- server.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index d7a60e2..a1e05e9 100644 --- a/server.js +++ b/server.js @@ -475,10 +475,14 @@ app.get('/api/claude-usage', async (req, res) => { lastSat.setDate(lastSat.getDate() - daysSinceSat); lastSat.setHours(14, 0, 0, 0); if (et < lastSat) lastSat.setDate(lastSat.getDate() - 7); - const weekMs = 7 * 24 * 60 * 60 * 1000; - const elapsed = et - lastSat; - const timePct = Math.min(100, Math.max(0, (elapsed / weekMs) * 100)); - const pace = timePct > 0 ? Math.round((usagePct / timePct) * 100) : null; + const weekMs = 7 * 24 * 60 * 60 * 1000; + // Exclude Sat 7AM–2PM (7h dead zone — Johan asleep, can't use Claude) + // Effective usable week = 168h - 7h = 161h, ending Sat 7AM instead of 2PM + const usableMs = 161 * 60 * 60 * 1000; + const elapsed = et - lastSat; + const effElapsed = Math.min(Math.max(0, elapsed), usableMs); + const timePct = Math.min(100, (effElapsed / usableMs) * 100); + const pace = timePct > 0 ? Math.round((usagePct / timePct) * 100) : null; res.json({ usage: usagePct, timePct: Math.round(timePct), pace }); } catch(e) {