-
${e.title}
-
- ${e.all_day ? formatDate(new Date(e.start_datetime)) : formatDateTime(e.start_datetime)}
- ${e.location ? ` · ${e.location}` : ''}
+ const today = new Date().toDateString();
+ const items = events.map((e) => {
+ const d = new Date(e.start_datetime);
+ const isToday = d.toDateString() === today;
+ const timeStr = e.all_day ? 'Ganztägig' : d.toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' }) + ' Uhr';
+ return `
+
+
+
+
${e.title}
+
+ ${isToday ? 'Heute' : formatDateTime(e.start_datetime).split(',')[0]}
+ ${timeStr}
+ ${e.location ? ` · ${e.location}` : ''}
+
-
- `).join('');
+ `;
+ }).join('');
- return `
`;
+ return `
`;
}
function renderTodayMeals(meals) {
- const header = `
-
- `;
+ const MEAL_ORDER = ['breakfast', 'lunch', 'dinner', 'snack'];
- if (!meals.length) {
- return `
`;
- }
+ const slots = MEAL_ORDER.map((type) => {
+ const meal = meals.find((m) => m.meal_type === type);
+ return `
+
+
+
${MEAL_LABELS[type]}
+
${meal ? meal.title : '—'}
+
+ `;
+ }).join('');
- const items = meals.map((m) => `
-
- ${MEAL_LABELS[m.meal_type]}
- ${m.title}
-
- `).join('');
-
- return `
`;
+ return `
`;
}
function renderPinnedNotes(notes) {
- const header = `
-
- `;
-
if (!notes.length) {
- return `