- labelt die Tabelle für Screenreader. */ ?>
- $table, 'caption' => 'Tabelle ' . ($team['name'] ?? '') . ($league ? ' · ' . $league : '')]); ?>
+
+ $next, 'results' => $results, 'table' => $table, 'caption' => $curCaption,
+ ]); ?>
+
+
+
+
+
+
+
+
+ $next, 'results' => $results, 'table' => $table, 'caption' => $curCaption,
+ ]); ?>
+
+
+ $previous['last_results'] ?? [], 'table' => $previous['table'] ?? [],
+ 'caption' => $prevCaption, 'is_previous' => true,
+ ]); ?>
-
-
-
-
+
diff --git a/app/pages/matchcenter.php b/app/pages/matchcenter.php
index f4ac3eb..ac29a1f 100644
--- a/app/pages/matchcenter.php
+++ b/app/pages/matchcenter.php
@@ -17,7 +17,7 @@ $meta = [
'title' => 'Matchcenter – Spiele, Ergebnisse & Tabellen',
'description' => 'Spielplan, Ergebnisse und Tabellen der Mannschaften des TSV 08 Kulmbach – 1. und 2. Mannschaft sowie Damen, automatisch aktuell.',
'og_image' => 'img/pages/fussball-hero-1600.jpg',
- 'scripts' => ['carousel.js', 'crest.js'],
+ 'scripts' => ['carousel.js', 'crest.js', 'group-tabs.js'],
'schema' => array_merge(
page_schema([
['name' => 'Startseite', 'slug' => ''],
diff --git a/bin/matchcenter-sync.php b/bin/matchcenter-sync.php
index c5c0fe1..6eb0d73 100644
--- a/bin/matchcenter-sync.php
+++ b/bin/matchcenter-sync.php
@@ -178,6 +178,29 @@ $dateDisplay = static function (?DateTimeImmutable $dt, string $raw) use ($weekd
return $weekdaysDe[(int) $dt->format('w')] . ', ' . $dt->format('d.m.');
};
+// --- Saison-Label (Fußball-Saison läuft Jul–Jun): aus dem jüngsten Spiel ableiten,
+// ersatzweise (leere Saison) aus dem heutigen Datum → liefert immer ein Label. ---
+$seasonLabel = static function (DateTimeImmutable $d): string {
+ $y = (int) $d->format('Y');
+ $start = (int) $d->format('n') >= 7 ? $y : $y - 1;
+ return sprintf('Saison %d/%02d', $start, ($start + 1) % 100);
+};
+$seasonFromRows = static function (array ...$rowSets) use ($seasonLabel, $tz, $today): string {
+ $latest = null;
+ foreach ($rowSets as $rows) {
+ foreach ($rows as $r) {
+ if (empty($r['kickoff'])) {
+ continue;
+ }
+ $dt = DateTimeImmutable::createFromFormat('Y-m-d\TH:i', (string) $r['kickoff'], $tz);
+ if ($dt && ($latest === null || $dt > $latest)) {
+ $latest = $dt;
+ }
+ }
+ }
+ return $seasonLabel($latest ?? $today);
+};
+
/**
* Ein Match aus der API in unser Anzeige-Format überführen.
* @param array