Erweiterung der Teamformatierungsfunktionen um Altersgruppen für bessere Anzeige in Spielplänen
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { listSpielplanSeasons, readSpielplanData, validateSeasonSlug } from '../../utils/spielplan-data.js'
|
||||
import { formatTeamDisplayName } from '../../../utils/team-display.js'
|
||||
|
||||
function teamLabel(teamName, teamAgeGroup) {
|
||||
return formatTeamDisplayName(teamName, teamAgeGroup)
|
||||
function teamLabel(teamName, teamAgeGroup, competitionAgeGroup) {
|
||||
return formatTeamDisplayName(teamName, teamAgeGroup, competitionAgeGroup)
|
||||
}
|
||||
|
||||
function extractHarheimerTeams(rows) {
|
||||
const seen = new Set()
|
||||
const teams = []
|
||||
|
||||
const addTeam = (teamName, teamAgeGroup) => {
|
||||
const addTeam = (teamName, teamAgeGroup, competitionAgeGroup) => {
|
||||
const name = String(teamName || '').trim()
|
||||
if (!name) return
|
||||
const age = String(teamAgeGroup || '').trim()
|
||||
@@ -18,7 +18,7 @@ function extractHarheimerTeams(rows) {
|
||||
seen.add(key)
|
||||
teams.push({
|
||||
key,
|
||||
label: teamLabel(name, age),
|
||||
label: teamLabel(name, age, competitionAgeGroup),
|
||||
teamName: name,
|
||||
teamAgeGroup: age
|
||||
})
|
||||
@@ -26,10 +26,10 @@ function extractHarheimerTeams(rows) {
|
||||
|
||||
for (const row of rows || []) {
|
||||
if (String(row.HeimVereinName || '').trim() === 'Harheimer TC') {
|
||||
addTeam(row.HeimMannschaft, row.HeimMannschaftAltersklasse)
|
||||
addTeam(row.HeimMannschaft, row.HeimMannschaftAltersklasse, row.Altersklasse)
|
||||
}
|
||||
if (String(row.GastVereinName || '').trim() === 'Harheimer TC') {
|
||||
addTeam(row.GastMannschaft, row.GastMannschaftAltersklasse)
|
||||
addTeam(row.GastMannschaft, row.GastMannschaftAltersklasse, row.Altersklasse)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user