feat: implement core UI module with tabs, forms and data management ; correct date autofilled
This commit is contained in:
parent
5563f7a794
commit
1e18875af2
8
js/ui.js
8
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user