feat: aktualisiere die Version auf 1.8.4 und verbessere die Erkennung von Jugendmannschaften in den Filterfunktionen
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 8m54s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m41s

This commit is contained in:
Torsten Schulz (local)
2026-07-17 13:46:25 +02:00
parent 1beb5c2eee
commit 281c25b05d
3 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "harheimertc-website",
"version": "1.8.3",
"version": "1.8.4",
"description": "Moderne Webseite für den Harheimer Tischtennis Club",
"private": true,
"type": "module",

View File

@@ -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

View File

@@ -54,7 +54,7 @@ function romanToNumber(value) {
}
function parseJugendTeamKey(teamKey) {
const match = String(teamKey || '').match(/^jugend_?j?(\d{1,2})(?:_([ivx]+|\d+))?$/i)
const match = String(teamKey || '').match(/^jugend(?:mannschaft)?_?j?(\d{1,2})(?:_([ivx]+|\d+))?$/i)
if (!match) return null
const teamNumber = match[2]