From f0de21dbde1ef03fb92e1afd827e017aa02d94fe Mon Sep 17 00:00:00 2001 From: Ricardo Campos Date: Mon, 3 Nov 2025 11:25:39 -0300 Subject: [PATCH] feat: enable to get calories from other months --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index fd93c68..a9426fb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -256,6 +256,10 @@ async function showMainApp() { updateCurrentDate(); // Get daily entries with total from Appwrite to display in calendar + fetchCaloriesCurrentMonth(); +} + +async function fetchCaloriesCurrentMonth() { const entries = await AppwriteDB.getMonthlyCalories(selectedDate); entries.forEach((entry) => { const calories = parseInt(entry.totalCalories); @@ -1203,6 +1207,7 @@ const selectDate = async (date: Date) => { selectedDate = date; updateCurrentDate(); await loadFoodEntries(date); + await fetchCaloriesCurrentMonth(); renderCalendar(); }