This commit is contained in:
Mateusz Gruszczyński
2025-09-18 21:36:39 +02:00
parent 577ac3f463
commit 556b1fd4b9

View File

@@ -94,6 +94,14 @@ document.addEventListener("DOMContentLoaded", function () {
this.classList.add("active");
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 (startDateInput) startDateInput.value = "";
if (endDateInput) endDateInput.value = "";
window.loadExpenses(r); // => /expenses_data?range=monthly|quarterly|halfyearly|yearly
return;
}
if (r === "currentmonth") {
const t = today();
const first = new Date(t.getFullYear(), t.getMonth(), 1);
@@ -113,6 +121,7 @@ document.addEventListener("DOMContentLoaded", function () {
return;
}
// reset pickera
if (startDateInput) startDateInput.value = "";
if (endDateInput) endDateInput.value = "";