|
|
|
|
@ -215,12 +215,9 @@ async function getActualDataAndFillView(monat = currentDate.getMonth(), jahr = c
|
|
|
|
|
document.getElementById('monthHourLDC').innerText = formatDuration(sumDurations(filteredEntries,2,true), true)
|
|
|
|
|
document.getElementById('monthHourOther').innerText = formatDuration(sumDurations(filteredEntries,3,true), true)
|
|
|
|
|
|
|
|
|
|
// Jahres Ansicht füllen
|
|
|
|
|
var requestYear = currentDate.getFullYear()
|
|
|
|
|
if (currentDate.getMonth() +1 >= 9) {
|
|
|
|
|
requestYear += 1;
|
|
|
|
|
}
|
|
|
|
|
var yearData = await filterEntriesByMonthYear(null, requestYear)
|
|
|
|
|
// Jahres Ansicht füllen (Dienstjahr, gekoppelt an den gerade angezeigten Monat/Jahr)
|
|
|
|
|
var requestServiceYear = getServiceYear(new Date(jahr, monat, 1));
|
|
|
|
|
var yearData = await filterEntriesByServiceYear(requestServiceYear)
|
|
|
|
|
yearData = formatDuration(sumDurations(yearData, null, true), true)
|
|
|
|
|
document.getElementById('yearHours').innerText = yearData
|
|
|
|
|
document.getElementById('yearRest').innerText = 600 - parseInt(yearData)
|
|
|
|
|
@ -358,7 +355,12 @@ document.getElementById('DeleteEntryButton').addEventListener('click', () => {
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
const monthEntrys = document.querySelectorAll('.monthEntrys');
|
|
|
|
|
var diffMonth = 0
|
|
|
|
|
|
|
|
|
|
// Cursor für die Monatsnavigation: echtes Kalenderjahr + 0-basierter Monat (JS-Konvention).
|
|
|
|
|
// Startet auf dem aktuellen Monat/Jahr und wird bei Vor/Zurück direkt fortgeschrieben,
|
|
|
|
|
// unabhängig vom Dienstjahr-Label - dadurch keine künstliche Sperre mehr bei Sept/Aug.
|
|
|
|
|
var cursorMonth = new Date().getMonth();
|
|
|
|
|
var cursorYear = new Date().getFullYear();
|
|
|
|
|
|
|
|
|
|
document.getElementById('dashbord_month_area').addEventListener('click', () =>{
|
|
|
|
|
if (!document.getElementById('dashbord_month_area').classList.contains('ActiveMonth')) {
|
|
|
|
|
@ -388,38 +390,32 @@ document.getElementById('dashbord_month_area').addEventListener('click', () =>{
|
|
|
|
|
element.classList.replace('fade-in', 'fade-out');
|
|
|
|
|
});
|
|
|
|
|
document.getElementById('MonthNameOfActual').innerHTML = "Monat:"
|
|
|
|
|
// document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth()];
|
|
|
|
|
diffMonth = 0;
|
|
|
|
|
getActualDataAndFillView(new Date().getMonth() + diffMonth)
|
|
|
|
|
cursorMonth = new Date().getMonth();
|
|
|
|
|
cursorYear = new Date().getFullYear();
|
|
|
|
|
getActualDataAndFillView(cursorMonth, cursorYear)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
document.getElementById('btn-month-before').addEventListener('click', () =>{
|
|
|
|
|
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)
|
|
|
|
|
if (cursorMonth === 0) {
|
|
|
|
|
// Januar -> Dezember des Vorjahres
|
|
|
|
|
cursorMonth = 11;
|
|
|
|
|
cursorYear -= 1;
|
|
|
|
|
} 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("CLICK-BEFORE-AFTER: ", diffMonth)
|
|
|
|
|
cursorMonth -= 1;
|
|
|
|
|
}
|
|
|
|
|
getActualDataAndFillView(cursorMonth, cursorYear)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.getElementById('btn-month-next').addEventListener('click', () =>{
|
|
|
|
|
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)
|
|
|
|
|
if (cursorMonth === 11) {
|
|
|
|
|
// Dezember -> Januar des Folgejahres
|
|
|
|
|
cursorMonth = 0;
|
|
|
|
|
cursorYear += 1;
|
|
|
|
|
} 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)
|
|
|
|
|
cursorMonth += 1;
|
|
|
|
|
}
|
|
|
|
|
getActualDataAndFillView(cursorMonth, cursorYear)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function setNewCalsOfMonth(TheMonth) {
|
|
|
|
|
|