podzial dzienny
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -132,12 +132,16 @@
|
||||
<div class="tab-pane fade" id="chartTab" role="tabpanel">
|
||||
<div class="card bg-dark text-white mb-4">
|
||||
<div class="card-body">
|
||||
<button class="btn btn-outline-light w-100 py-2 mb-2 d-flex align-items-center justify-content-center gap-2" id="toggleCategorySplit">
|
||||
Pokaż podział na kategorie
|
||||
</button>
|
||||
<button class="btn btn-outline-light w-100 py-2 mb-2 d-flex align-items-center justify-content-center gap-2" id="toggleDailySplit">
|
||||
Pokaż podział dzienny
|
||||
</button>
|
||||
|
||||
<div class="d-flex gap-2 mb-2">
|
||||
<button class="btn btn-outline-light flex-fill py-2 mb-0 d-flex align-items-center justify-content-center gap-2" id="toggleCategorySplit">
|
||||
Pokaż podział na kategorie
|
||||
</button>
|
||||
<button class="btn btn-outline-light flex-fill py-2 mb-0 d-flex align-items-center justify-content-center gap-2" id="toggleDailySplit">
|
||||
Pokaż podział dzienny
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p id="chartRangeLabel" class="fw-bold mb-3">Widok: miesięczne</p>
|
||||
<canvas id="expensesChart" height="120"></canvas>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user