slack status without the slack status.zzstoatzz.io/
quickslice

fix: show 'expired Xm ago' for past expiration times

instead of showing "clears now" for already-expired statuses, now
displays "expired", "expired Xm ago", "expired Xh ago", or "expired Xd ago"
depending on how long ago the status expired.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+23 -2
+23 -2
site/app.js
··· 342 342 : TimestampFormatter.formatRelative(date); 343 343 } 344 344 345 + function formatExpiration(dateStr) { 346 + const date = new Date(dateStr); 347 + const now = new Date(); 348 + const diffMs = date - now; 349 + 350 + // Already expired - show how long ago 351 + if (diffMs <= 0) { 352 + const agoMs = Math.abs(diffMs); 353 + const agoMins = Math.floor(agoMs / 60000); 354 + if (agoMins < 1) return 'expired'; 355 + if (agoMins < 60) return `expired ${agoMins}m ago`; 356 + const agoHours = Math.floor(agoMs / 3600000); 357 + if (agoHours < 24) return `expired ${agoHours}h ago`; 358 + const agoDays = Math.floor(agoMs / 86400000); 359 + return `expired ${agoDays}d ago`; 360 + } 361 + 362 + // Future - show when it clears 363 + return `clears ${relativeTimeFuture(dateStr)}`; 364 + } 365 + 345 366 function relativeTimeFuture(dateStr) { 346 367 const date = new Date(dateStr); 347 368 const now = new Date(); ··· 807 828 808 829 if (statuses.length > 0) { 809 830 const current = statuses[0]; 810 - const expiresHtml = current.expires ? ` • clears ${relativeTimeFuture(current.expires)}` : ''; 831 + const expiresHtml = current.expires ? ` • ${formatExpiration(current.expires)}` : ''; 811 832 currentHtml = ` 812 833 <span class="big-emoji">${renderEmoji(current.emoji)}</span> 813 834 <div class="status-info"> ··· 1095 1116 } 1096 1117 1097 1118 const current = statuses[0]; 1098 - const expiresHtml = current.expires ? ` • clears ${relativeTimeFuture(current.expires)}` : ''; 1119 + const expiresHtml = current.expires ? ` • ${formatExpiration(current.expires)}` : ''; 1099 1120 let html = ` 1100 1121 <div class="profile-card"> 1101 1122 <div class="current-status">