Fügt die Anzeige des letzten Trainingsdatums und einen Sortiermechanismus in der Mitgliederstatistik hinzu. Aktualisiert die Backend-Logik zur Berechnung des letzten Trainings und passt die Benutzeroberfläche in TrainingStatsView.vue entsprechend an.
This commit is contained in:
@@ -95,6 +95,10 @@ class TrainingStatsController {
|
||||
endTime: '--:--'
|
||||
}));
|
||||
|
||||
// Letztes Training
|
||||
const lastTrainingDate = trainingDetails.length ? trainingDetails[0].diaryDate.date : null;
|
||||
const lastTrainingTs = lastTrainingDate ? new Date(lastTrainingDate).getTime() : 0;
|
||||
|
||||
stats.push({
|
||||
id: member.id,
|
||||
firstName: member.firstName,
|
||||
@@ -103,6 +107,8 @@ class TrainingStatsController {
|
||||
participation12Months,
|
||||
participation3Months,
|
||||
participationTotal,
|
||||
lastTraining: lastTrainingDate,
|
||||
lastTrainingTs,
|
||||
trainingDetails: formattedTrainingDetails
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,6 +48,12 @@
|
||||
<span class="sort-icon">{{ getSortIcon('participationTotal') }}</span>
|
||||
</div>
|
||||
</th>
|
||||
<th @click="sortBy('lastTrainingTs')" class="sortable-header">
|
||||
<div class="header-content">
|
||||
<span>Letztes Training</span>
|
||||
<span class="sort-icon">{{ getSortIcon('lastTrainingTs') }}</span>
|
||||
</div>
|
||||
</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -58,6 +64,7 @@
|
||||
<td>{{ member.participation12Months }}</td>
|
||||
<td>{{ member.participation3Months }}</td>
|
||||
<td>{{ member.participationTotal }}</td>
|
||||
<td>{{ formatDate(member.lastTraining) || '-' }}</td>
|
||||
<td>
|
||||
<button @click="showMemberDetails(member)" class="btn-primary btn-small">
|
||||
Details anzeigen
|
||||
|
||||
Reference in New Issue
Block a user