feat: aktualisiere die Version auf 1.8.4 und verbessere die Erkennung von Jugendmannschaften in den Filterfunktionen
This commit is contained in:
@@ -56,7 +56,7 @@ function romanToNumber(value) {
|
||||
|
||||
function getCmsTeamCriteria(name, league) {
|
||||
const teamName = String(name || '').trim()
|
||||
const youth = teamName.match(/^jugend\s+j(\d{1,2})(?:\s+([ivx]+|\d+))?\b/i)
|
||||
const youth = teamName.match(/^jugend(?:mannschaft)?\s+j(\d{1,2})(?:\s+([ivx]+|\d+))?\b/i)
|
||||
if (youth) {
|
||||
const rawNumber = youth[2]
|
||||
return {
|
||||
@@ -67,9 +67,9 @@ function getCmsTeamCriteria(name, league) {
|
||||
|
||||
// In bestehenden CMS-Daten steht die Altersklasse häufig nur in der Liga,
|
||||
// z. B. Mannschaft "Jugend I" mit Liga "Jugend 13 (J13)".
|
||||
const ageMatch = `${teamName} ${String(league || '')}`.match(/\b(?:jugend\s*|j\s*\(?)(\d{1,2})\b/i)
|
||||
const ageMatch = `${teamName} ${String(league || '')}`.match(/\b(?:jugend(?:mannschaft)?\s*|j\s*\(?)(\d{1,2})\b/i)
|
||||
if (ageMatch) {
|
||||
const ordinal = teamName.match(/^jugend\s+([ivx]+|\d+)\b/i)?.[1]
|
||||
const ordinal = teamName.match(/^jugend(?:mannschaft)?\s+([ivx]+|\d+)\b/i)?.[1]
|
||||
return {
|
||||
ageClass: `Jugend ${ageMatch[1]}`,
|
||||
teamNumber: ordinal ? (Number(ordinal) || romanToNumber(ordinal)) : null
|
||||
|
||||
Reference in New Issue
Block a user