feat: implement UI module with tab navigation, form handling and data visualization
This commit is contained in:
parent
2cb2c10482
commit
5563f7a794
6
js/ui.js
6
js/ui.js
@ -71,9 +71,11 @@ const UI = (() => {
|
||||
tabs[tabKey].btn.classList.add('active');
|
||||
tabs[tabKey].content.classList.add('active');
|
||||
|
||||
// If switching to meals tab, ensure form is populated for the current meal date
|
||||
// If switching to meals tab, always reset to today and autofill
|
||||
if (tabKey === 'meals') {
|
||||
populateMealFormForDate(document.getElementById('meal-date').value);
|
||||
const todayUIDate = Utils.toUIDate(Utils.getTodayDate());
|
||||
document.getElementById('meal-date').value = todayUIDate;
|
||||
populateMealFormForDate(todayUIDate);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user