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);
|
renderGrid(wrapper, exportBtn);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
yearSel.addEventListener('change', () => {
|
||||||
|
currentYear = parseInt(yearSel.value);
|
||||||
|
loadPlanFromHistory();
|
||||||
|
renderGrid(wrapper, exportBtn);
|
||||||
|
});
|
||||||
|
|
||||||
genBtn.addEventListener('click', () => {
|
genBtn.addEventListener('click', () => {
|
||||||
if (state.employees.length === 0) {
|
if (state.employees.length === 0) {
|
||||||
alert('Bitte zuerst Mitarbeiter hinzufügen.');
|
alert('Bitte zuerst Mitarbeiter hinzufügen.');
|
||||||
@@ -106,7 +112,7 @@ function loadPlanFromHistory() {
|
|||||||
const prefix = currentYear + '-' + String(currentMonth).padStart(2,'0');
|
const prefix = currentYear + '-' + String(currentMonth).padStart(2,'0');
|
||||||
currentPlan = state.history
|
currentPlan = state.history
|
||||||
.filter(h => h.date.startsWith(prefix))
|
.filter(h => h.date.startsWith(prefix))
|
||||||
.slice();
|
.map(h => ({ ...h }));
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderGrid(wrapper, exportBtn) {
|
function renderGrid(wrapper, exportBtn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user