diff --git a/src/routes/match/[id]/+layout.svelte b/src/routes/match/[id]/+layout.svelte
index 1dfe61c..5382ed7 100644
--- a/src/routes/match/[id]/+layout.svelte
+++ b/src/routes/match/[id]/+layout.svelte
@@ -33,9 +33,13 @@
{ label: 'Chat', href: `/match/${match.match_id}/chat` }
];
- const formattedDate = new Date(match.date).toLocaleString('en-US', {
- dateStyle: 'medium',
- timeStyle: 'short'
+ // Shorter date format: "Sep 5, 4:30 PM" (no year - saves space in card)
+ const matchDate = new Date(match.date);
+ const formattedDate = matchDate.toLocaleString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ hour: 'numeric',
+ minute: '2-digit'
});
const duration = match.duration
@@ -45,6 +49,10 @@
const mapName = formatMapName(match.map);
const mapBg = getMapBackground(match.map);
+ // Check if match is older than 4 weeks (Valve deletes demos after ~4 weeks)
+ const fourWeeksMs = 4 * 7 * 24 * 60 * 60 * 1000;
+ const isMatchOlderThanFourWeeks = Date.now() - matchDate.getTime() > fourWeeksMs;
+
function handleImageError(event: Event) {
const img = event.target as HTMLImageElement;
img.src = '/images/map_screenshots/default.webp';
@@ -65,8 +73,9 @@
window.location.href = downloadUrl;
}
- // Check if demo download is available
- const canDownloadDemo = match.replay_url || (match.demo_parsed && match.share_code);
+ // Demo download: always available if replay_url exists, otherwise only for recent matches
+ const canDownloadDemo =
+ match.replay_url || (match.demo_parsed && match.share_code && !isMatchOlderThanFourWeeks);
@@ -158,12 +167,12 @@