diff --git a/app/static/app/js/home.js b/app/static/app/js/home.js index 4159eb5..4cc31bf 100644 --- a/app/static/app/js/home.js +++ b/app/static/app/js/home.js @@ -6,8 +6,6 @@ const SETStudySaveButton = document.getElementById('SETStudySaveButton') const SETMonthGoalSaveButton = document.getElementById('SETMonthGoalSaveButton') var allowToSend = false; const monate = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]; -const aktuellerMonat = monate[new Date().getMonth()]; -// Aktuelles Datum const currentDate = new Date(); @@ -162,7 +160,8 @@ async function getActualDataAndFillView(monat = currentDate.getMonth(), jahr = c // Einfüfen des aktuellen Monats document.getElementById('actualMonthName').innerHTML = monate[monat !== 12 ? monat : 0]; - console.log(monat) + console.log("AKTUELLER MONAT SYSTEM: ", monat) + console.log("AKTUELLER MONAT REAL: ", currentDate.getMonth()) // Settings vor ausfüllen @@ -387,27 +386,31 @@ document.getElementById('dashbord_month_area').addEventListener('click', () =>{ }) document.getElementById('btn-month-before').addEventListener('click', () =>{ - // console.log(diffMonth) - if (diffMonth === 0) { - diffMonth = 11; + console.log("CLICK-BEFORE: ", diffMonth) + if (new Date().getMonth() + diffMonth == 0) { + diffMonth = 11 - new Date().getMonth(); getActualDataAndFillView(new Date().getMonth() + diffMonth) + console.log("CLICK-BEFRORE-0TO11: ", diffMonth) } else { diffMonth = ((monate[new Date().getMonth() + diffMonth]) != 'September') ? diffMonth - 1 : diffMonth; // document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth() + diffMonth]; getActualDataAndFillView(new Date().getMonth() + diffMonth) }; - // console.log(diffMonth) + console.log("CLICK-BEFORE-AFTER: ", diffMonth) }); document.getElementById('btn-month-next').addEventListener('click', () =>{ - if (diffMonth === 11) { - diffMonth = 0; + console.log("CLICK-NEXT: ", diffMonth) + if (new Date().getMonth() + diffMonth == 11) { + diffMonth = 0 - new Date().getMonth(); getActualDataAndFillView(new Date().getMonth() + diffMonth) + console.log("CLICK-NEXT-11TO0: ", diffMonth) } else { diffMonth = ((monate[new Date().getMonth() + diffMonth]) != 'August') ? diffMonth + 1 : diffMonth; // document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth() + diffMonth]; getActualDataAndFillView(new Date().getMonth() + diffMonth) }; + console.log("CLICK-NEXT-AFTER: ", diffMonth) }) function setNewCalsOfMonth(TheMonth) {