zakresy z kubelkow w backendzie
This commit is contained in:
@@ -96,31 +96,13 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const r = this.getAttribute("data-range"); // last30days/currentmonth/monthly/quarterly/halfyearly/yearly
|
||||
|
||||
// Zakresy kubełkowane – bez start/end, bez "daily"
|
||||
if (["monthly", "quarterly", "halfyearly", "yearly"].includes(r)) {
|
||||
if (["monthly", "quarterly", "halfyearly", "yearly", "currentmonth", "last30days"].includes(r)) {
|
||||
if (startDateInput) startDateInput.value = "";
|
||||
if (endDateInput) endDateInput.value = "";
|
||||
window.loadExpenses(r); // => /expenses_data?range=monthly|quarterly|halfyearly|yearly
|
||||
window.loadExpenses(r); // => /expenses_data?range=<r>
|
||||
return;
|
||||
}
|
||||
|
||||
if (r === "currentmonth") {
|
||||
const t = today();
|
||||
const first = new Date(t.getFullYear(), t.getMonth(), 1);
|
||||
if (isDailyActive()) {
|
||||
window.loadExpenses("daily", iso(first), iso(t));
|
||||
} else {
|
||||
window.loadExpenses("monthly", iso(first), iso(t));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (r === "last30days") {
|
||||
if (isDailyActive()) {
|
||||
window.loadExpenses("daily", iso(daysAgo(30)), iso(today()));
|
||||
} else {
|
||||
window.loadExpenses("last30days");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// reset pickera
|
||||
if (startDateInput) startDateInput.value = "";
|
||||
|
@@ -150,7 +150,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<p id="chartRangeLabel" class="fw-bold mb-3">Wybrany zakres: miesięczne</p>
|
||||
<p id="chartRangeLabel" class="fw-bold mb-3">Widok: miesięczne</p>
|
||||
<canvas id="expensesChart" height="120"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user