charts, legend bottom

This commit is contained in:
Mateusz Gruszczyński
2025-07-31 23:21:49 +02:00
parent 1049a69cb8
commit 0c1b9aebf5

View File

@@ -111,12 +111,14 @@ 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 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);
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);
loadExpenses();