From 1e18875af28164b2ecc10b61b607b1f502e1f44b Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 31 May 2025 08:44:37 +0200 Subject: [PATCH] feat: implement core UI module with tabs, forms and data management ; correct date autofilled --- js/ui.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/ui.js b/js/ui.js index e907226..62d0527 100644 --- a/js/ui.js +++ b/js/ui.js @@ -27,7 +27,7 @@ const UI = (() => { const init = () => { // Set today's date as default for forms document.getElementById('weight-date').value = Utils.toUIDate(Utils.getTodayDate()); - document.getElementById('meal-date').value = Utils.toUIDate(Utils.getTodayDate()); + document.getElementById('meal-date').value = Utils.getTodayDate(); // Initialize tab navigation initTabs(); @@ -73,9 +73,9 @@ const UI = (() => { // If switching to meals tab, always reset to today and autofill if (tabKey === 'meals') { - const todayUIDate = Utils.toUIDate(Utils.getTodayDate()); - document.getElementById('meal-date').value = todayUIDate; - populateMealFormForDate(todayUIDate); + const todayISODate = Utils.getTodayDate(); + document.getElementById('meal-date').value = todayISODate; + populateMealFormForDate(todayISODate); } };