From f0e1ad39b0ce0b139e3f4ab3fba1cf55e1ddb56f Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Fri, 17 Jul 2026 10:33:46 +0200 Subject: [PATCH] =?UTF-8?q?Verbessere=20die=20Altersklassenerkennung=20in?= =?UTF-8?q?=20der=20Funktion=20sideMatchesJugendTeam=20durch=20Verwendung?= =?UTF-8?q?=20eines=20regul=C3=A4ren=20Ausdrucks=20zur=20genauen=20=C3=9Cb?= =?UTF-8?q?ereinstimmung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/spielplan-filter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/spielplan-filter.js b/utils/spielplan-filter.js index 85ea2f0..20462c2 100644 --- a/utils/spielplan-filter.js +++ b/utils/spielplan-filter.js @@ -66,8 +66,8 @@ function parseJugendTeamKey(teamKey) { function sideMatchesJugendTeam({ isHarheimer, ageClass, teamNumber }, team) { if (!isHarheimer) return false - const agePattern = new RegExp(`(?:jugend\\s*|j)${team.age}\\b`, 'i') - if (!agePattern.test(ageClass)) return false + const ageMatch = String(ageClass || '').match(/(?:jugend\s*|j)(\d{1,2})\b/i) + if (!ageMatch || ageMatch[1] !== team.age) return false return !team.teamNumber || String(teamNumber || '').trim() === team.teamNumber }