diff --git a/frontend/src/components/StatusBox.vue b/frontend/src/components/StatusBox.vue index 359dc22..aec59c3 100644 --- a/frontend/src/components/StatusBox.vue +++ b/frontend/src/components/StatusBox.vue @@ -391,8 +391,8 @@ const displayRows = computed(() => { // Füge andere Stats hinzu const map = [ - ['Überstunden (Woche)', 'overtime'], - ['Überstunden (Gesamt)', 'totalOvertime'], + ['overtime', 'overtime'], // Label wird dynamisch gesetzt + ['totalOvertime', 'totalOvertime'], // Label wird dynamisch gesetzt // ['Überstunden (Alt-Style)', 'totalOvertimeOldStyle'], // DEBUG: Versteckt, da getWeekOverview nicht korrekte Zeiten liefert ['Wochenarbeitszeit', 'weekWorktime'], ['Arbeitsfreie Stunden', 'nonWorkingHours'], @@ -412,7 +412,23 @@ const displayRows = computed(() => { const val = stats.value?.[key] if (val !== undefined && val !== null && val !== '') { - rows[label] = val + // Spezialbehandlung für Überstunden/Fehlzeit Labels + if (key === 'overtime') { + const isNegative = val.startsWith('-'); + const displayLabel = isNegative ? 'Fehlzeit (Woche)' : 'Überstunden (Woche)'; + const displayValue = isNegative ? val.substring(1) : val; // Entferne Minus-Zeichen + rows[displayLabel] = displayValue; + } else if (key === 'totalOvertime') { + const isNegative = val.startsWith('-'); + const displayLabel = isNegative ? 'Fehlzeit (Gesamt)' : 'Überstunden (Gesamt)'; + const displayValue = isNegative ? val.substring(1) : val; // Entferne Minus-Zeichen + rows[displayLabel] = displayValue; + } else if (key === 'adjustedEndTodayGeneral' || key === 'adjustedEndTodayWeek') { + // Füge " Uhr" zu Uhrzeiten hinzu + rows[label] = val + ' Uhr'; + } else { + rows[label] = val; + } } else { rows[label] = '—' }