fix: wire year selector and fix shallow copy in loadPlanFromHistory
This commit is contained in:
@@ -82,6 +82,12 @@ export function renderCalendar() {
|
||||
renderGrid(wrapper, exportBtn);
|
||||
});
|
||||
|
||||
yearSel.addEventListener('change', () => {
|
||||
currentYear = parseInt(yearSel.value);
|
||||
loadPlanFromHistory();
|
||||
renderGrid(wrapper, exportBtn);
|
||||
});
|
||||
|
||||
genBtn.addEventListener('click', () => {
|
||||
if (state.employees.length === 0) {
|
||||
alert('Bitte zuerst Mitarbeiter hinzufügen.');
|
||||
@@ -106,7 +112,7 @@ function loadPlanFromHistory() {
|
||||
const prefix = currentYear + '-' + String(currentMonth).padStart(2,'0');
|
||||
currentPlan = state.history
|
||||
.filter(h => h.date.startsWith(prefix))
|
||||
.slice();
|
||||
.map(h => ({ ...h }));
|
||||
}
|
||||
|
||||
function renderGrid(wrapper, exportBtn) {
|
||||
|
||||
Reference in New Issue
Block a user