diff --git a/static/js/chart_controls.js b/static/js/chart_controls.js index 69c8199..75a6127 100644 --- a/static/js/chart_controls.js +++ b/static/js/chart_controls.js @@ -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= 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 = ""; diff --git a/templates/expenses.html b/templates/expenses.html index ab48621..e231606 100644 --- a/templates/expenses.html +++ b/templates/expenses.html @@ -150,7 +150,7 @@ -

Wybrany zakres: miesięczne

+

Widok: miesięczne