feat: implement core UI module with tabs, forms and data management ; correct date autofilled

This commit is contained in:
Greg 2025-05-31 08:44:37 +02:00
parent 5563f7a794
commit 1e18875af2

View File

@ -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);
}
};