feat(official-tournaments): enhance gender detection logic with localized case handling and additional abbreviations
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 9m49s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 9m49s
This commit is contained in:
@@ -2042,9 +2042,10 @@ export default {
|
||||
return age;
|
||||
},
|
||||
getGenderRule(c) {
|
||||
const txt = `${c.ageClassCompetition || c.altersklasseWettbewerb || ''} ${c.openTo || c.offenFuer || ''}`.toLowerCase();
|
||||
if (/(mädchen|weiblich|\bw\b)/.test(txt)) return 'female';
|
||||
if (/(jungen|männlich|\bm\b)/.test(txt)) return 'male';
|
||||
const txt = `${c.ageClassCompetition || c.altersklasseWettbewerb || ''} ${c.openTo || c.offenFuer || ''}`.toLocaleLowerCase('de');
|
||||
// myTischtennis kürzt Mädchen-/Jungen-Konkurrenzen häufig als M13 bzw. J13 ab.
|
||||
if (/(mädchen|weiblich|damen|\b(?:m|w)\d{1,2}\b|\bw\b)/.test(txt)) return 'female';
|
||||
if (/(jungen|männlich|herren|\bj\d{1,2}\b|\bm\b)/.test(txt)) return 'male';
|
||||
if (/jugend/.test(txt)) return 'both';
|
||||
return 'both';
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user