feat: Sort members by first name and then last name in member lists
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s
This commit is contained in:
@@ -227,14 +227,14 @@ export default {
|
||||
const filteredMembers = members.filter(m => m != null);
|
||||
// Sortiere alphabetisch nach Nachname, dann Vorname
|
||||
this.members = filteredMembers.sort((a, b) => {
|
||||
const lastNameA = (a.lastName || '').toLowerCase();
|
||||
const lastNameB = (b.lastName || '').toLowerCase();
|
||||
if (lastNameA !== lastNameB) {
|
||||
return lastNameA.localeCompare(lastNameB);
|
||||
}
|
||||
const firstNameA = (a.firstName || '').toLowerCase();
|
||||
const firstNameB = (b.firstName || '').toLowerCase();
|
||||
return firstNameA.localeCompare(firstNameB);
|
||||
if (firstNameA !== firstNameB) {
|
||||
return firstNameA.localeCompare(firstNameB);
|
||||
}
|
||||
const lastNameA = (a.lastName || '').toLowerCase();
|
||||
const lastNameB = (b.lastName || '').toLowerCase();
|
||||
return lastNameA.localeCompare(lastNameB);
|
||||
});
|
||||
console.log('[loadMembers] Loaded', this.members.length, 'active members');
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user