feat: aktualisiere die Version auf 1.8.4 und verbessere die Erkennung von Jugendmannschaften in den Filterfunktionen
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harheimertc-website",
|
"name": "harheimertc-website",
|
||||||
"version": "1.8.3",
|
"version": "1.8.4",
|
||||||
"description": "Moderne Webseite für den Harheimer Tischtennis Club",
|
"description": "Moderne Webseite für den Harheimer Tischtennis Club",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ function romanToNumber(value) {
|
|||||||
|
|
||||||
function getCmsTeamCriteria(name, league) {
|
function getCmsTeamCriteria(name, league) {
|
||||||
const teamName = String(name || '').trim()
|
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) {
|
if (youth) {
|
||||||
const rawNumber = youth[2]
|
const rawNumber = youth[2]
|
||||||
return {
|
return {
|
||||||
@@ -67,9 +67,9 @@ function getCmsTeamCriteria(name, league) {
|
|||||||
|
|
||||||
// In bestehenden CMS-Daten steht die Altersklasse häufig nur in der Liga,
|
// In bestehenden CMS-Daten steht die Altersklasse häufig nur in der Liga,
|
||||||
// z. B. Mannschaft "Jugend I" mit Liga "Jugend 13 (J13)".
|
// 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) {
|
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 {
|
return {
|
||||||
ageClass: `Jugend ${ageMatch[1]}`,
|
ageClass: `Jugend ${ageMatch[1]}`,
|
||||||
teamNumber: ordinal ? (Number(ordinal) || romanToNumber(ordinal)) : null
|
teamNumber: ordinal ? (Number(ordinal) || romanToNumber(ordinal)) : null
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ function romanToNumber(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseJugendTeamKey(teamKey) {
|
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
|
if (!match) return null
|
||||||
|
|
||||||
const teamNumber = match[2]
|
const teamNumber = match[2]
|
||||||
|
|||||||
Reference in New Issue
Block a user