podzial dzienny

This commit is contained in:
Mateusz Gruszczyński
2025-09-17 21:18:48 +02:00
parent 3f9011aac1
commit d87a0aacfb
2 changed files with 19 additions and 9 deletions

View File

@@ -120,6 +120,7 @@ document.addEventListener("DOMContentLoaded", function () {
loadExpenses();
});
toggleBtn.textContent = "🔵 Pokaż całościowo";
toggleBtn.classList.remove("btn-outline-warning");
toggleBtn.classList.add("btn-outline-info");
@@ -173,9 +174,14 @@ document.addEventListener("DOMContentLoaded", function () {
}
document.getElementById('toggleDailySplit').addEventListener('click', function() {
// Zmień typ podziału na dzienny i odśwież dane wykresu
currentRangeType = 'daily';
refreshChart();
// Pobierz aktualne daty jeśli są ustawione w inputach
const startDateInput = document.getElementById('startDate');
const endDateInput = document.getElementById('endDate');
let startDate = startDateInput ? startDateInput.value : null;
let endDate = endDateInput ? endDateInput.value : null;
// Wywołaj funkcję z "daily" jako typ zakresu
loadExpenses('daily', startDate, endDate);
});
});