From f2e99821f7021067d2158f67ec2e13473c10efea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Thu, 18 Sep 2025 21:09:15 +0200 Subject: [PATCH] fix1 --- static/js/chart_controls.js | 16 ++++++++++++++-- templates/expenses.html | 11 +++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/static/js/chart_controls.js b/static/js/chart_controls.js index 3d63335..58cfe28 100644 --- a/static/js/chart_controls.js +++ b/static/js/chart_controls.js @@ -140,12 +140,24 @@ document.addEventListener("DOMContentLoaded", function () { reloadRespectingSplit(); }); + // ——— Inicjalizacja ——— // Podpowiedź dat do inputów + + + //if (startDateInput && endDateInput) { + // startDateInput.value = iso(daysAgo(7)); + // endDateInput.value = iso(today()); + //} + if (startDateInput && endDateInput) { - startDateInput.value = iso(daysAgo(7)); - endDateInput.value = iso(today()); + const now = new Date(); + const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1); + + startDateInput.value = iso(startOfMonth); + endDateInput.value = iso(now); } + setActiveTimeSplit("daily"); reloadRespectingSplit(); }); diff --git a/templates/expenses.html b/templates/expenses.html index 8586389..f6bcc78 100644 --- a/templates/expenses.html +++ b/templates/expenses.html @@ -137,15 +137,18 @@
Podział według czasu
- -
Podział według kategorii
-
@@ -160,7 +163,7 @@
- +