charts, legend bottom

This commit is contained in:
Mateusz Gruszczyński
2025-07-31 23:22:46 +02:00
parent 0c1b9aebf5
commit 2df64bbe2e

View File

@@ -112,13 +112,12 @@ document.addEventListener("DOMContentLoaded", function () {
const startDateInput = document.getElementById("startDate");
const endDateInput = document.getElementById("endDate");
// domyslnie 1-dzis w custom zakresie
const today = new Date();
const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
startDateInput.value = formatDate(firstDay);
endDateInput.value = formatDate(lastDay);
const lastWeek = new Date(today);
lastWeek.setDate(today.getDate() - 7);
const formatDate = (d) => d.toISOString().split('T')[0];
startDateInput.value = formatDate(lastWeek);
endDateInput.value = formatDate(today);
loadExpenses();