feat: enable updating time from a food entry

- Add visible time input (foodEntryTime) in index.html, hidden by default
- Show time input only when editing a food entry (setFoodToEdit)
- Use foodEntryTime value when saving an edited entry (updateFood)
- Hide and reset time input on clearEditing (cancel/save)
- input type=time ensures HH:MM format is preserved

Agent-Logs-Url: https://github.com/RMCampos/calories-tracker/sessions/085efbe7-b9c8-4a81-a58f-5dbdf91f2942

Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-27 19:20:15 +00:00
committed by GitHub
parent b07861f88f
commit e4fa1f9c1c
3 changed files with 13 additions and 287 deletions
+4
View File
@@ -267,6 +267,10 @@
<label for="gramAmount">Amount (grams)</label>
<input type="number" id="gramAmount" min="1" step="1" value="100">
</div>
<div class="form-group hidden" id="foodTimeGroup">
<label for="foodEntryTime">Time</label>
<input type="time" id="foodEntryTime">
</div>
<button class="add-btn" id="add-food-btn">Add Food</button>
<button class="cancel-btn" id="cancel-food-btn">Cancel</button>
</div>