Gehe zu button, Verwaltung Urlaubsberechnung

This commit is contained in:
2026-02-05 13:42:30 +01:00
parent 3c282a0f3c
commit 4bd289a990
5 changed files with 106 additions and 16 deletions

View File

@@ -38,6 +38,11 @@
<button id="prevWeek" class="btn btn-secondary">◀ Vorherige Woche</button>
<h2 id="weekTitle">Kalenderwoche</h2>
<button id="nextWeek" class="btn btn-secondary">Nächste Woche ▶</button>
<div class="week-selector-goto">
<input type="text" id="goToWeekInput" placeholder="z. B. 12 oder 2025 12" class="form-control" />
<button type="button" id="goToWeekBtn" class="btn btn-secondary">Gehe zu KW</button>
<span id="goToWeekError" class="go-to-week-error" aria-live="polite"></span>
</div>
</div>
<div id="timesheetTable">

View File

@@ -334,10 +334,13 @@
${data.remainingOvertimeWithOffset !== undefined ? `<span style="color: #28a745;">(verbleibend inkl. Offset: ${Number(data.remainingOvertimeWithOffset).toFixed(2)} h)</span>` : ''}
</div>`;
}
if (data.vacationDays !== undefined) {
if (data.totalVacationDays !== undefined || data.vacationDays !== undefined) {
const totalTaken = data.totalVacationDays !== undefined ? data.totalVacationDays : 0;
const inWeek = data.vacationDays !== undefined ? data.vacationDays : 0;
statsHTML += `<div class="stats-inline" style="display: inline-block; margin-right: 20px;">
<strong>Urlaub genommen:</strong> <span>${data.vacationDays.toFixed(1)} Tag${data.vacationDays !== 1 ? 'e' : ''}</span>
${data.remainingVacation !== undefined ? `<span style="color: #28a745;">(verbleibend: ${data.remainingVacation.toFixed(1)} Tage)</span>` : ''}
<strong>Urlaub genommen (kumuliert bis Ende KW):</strong> <span>${Number(totalTaken).toFixed(1)} Tag${totalTaken !== 1 ? 'e' : ''}</span>
${inWeek > 0 ? ` <span style="color: #666;">(davon in dieser Woche: ${inWeek.toFixed(1)})</span>` : ''}
${data.remainingVacation !== undefined ? ` <span style="color: #28a745;">(verbleibend Stand Ende KW: ${Number(data.remainingVacation).toFixed(1)} Tage)</span>` : ''}
</div>`;
}
if (data.vacationOffsetDays !== undefined && data.vacationOffsetDays !== 0) {