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 = () => {
|
const init = () => {
|
||||||
// Set today's date as default for forms
|
// Set today's date as default for forms
|
||||||
document.getElementById('weight-date').value = Utils.toUIDate(Utils.getTodayDate());
|
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
|
// Initialize tab navigation
|
||||||
initTabs();
|
initTabs();
|
||||||
@ -73,9 +73,9 @@ const UI = (() => {
|
|||||||
|
|
||||||
// If switching to meals tab, always reset to today and autofill
|
// If switching to meals tab, always reset to today and autofill
|
||||||
if (tabKey === 'meals') {
|
if (tabKey === 'meals') {
|
||||||
const todayUIDate = Utils.toUIDate(Utils.getTodayDate());
|
const todayISODate = Utils.getTodayDate();
|
||||||
document.getElementById('meal-date').value = todayUIDate;
|
document.getElementById('meal-date').value = todayISODate;
|
||||||
populateMealFormForDate(todayUIDate);
|
populateMealFormForDate(todayISODate);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user