diff --git a/public/pages/budget.js b/public/pages/budget.js index 8ce33f1..9ee9a26 100644 --- a/public/pages/budget.js +++ b/public/pages/budget.js @@ -8,7 +8,7 @@ import { api } from '/api.js'; import { openModal as openSharedModal, closeModal } from '/components/modal.js'; import { stagger, vibrate } from '/utils/ux.js'; -import { t, formatDate } from '/i18n.js'; +import { t, formatDate, getLocale } from '/i18n.js'; // -------------------------------------------------------- // Konstanten @@ -34,7 +34,7 @@ const CATEGORY_LABELS = () => ({ function getMonthName(monthIndex) { // monthIndex: 0-based (0=Januar, 11=Dezember) const date = new Date(2000, monthIndex, 1); - return new Intl.DateTimeFormat(document.documentElement.lang || 'de', { month: 'long' }).format(date); + return new Intl.DateTimeFormat(getLocale(), { month: 'long' }).format(date); } // -------------------------------------------------------- diff --git a/public/pages/calendar.js b/public/pages/calendar.js index 298e488..6f881c0 100644 --- a/public/pages/calendar.js +++ b/public/pages/calendar.js @@ -665,7 +665,7 @@ function showEventPopup(ev, anchor) { const timeStr = ev.all_day ? t('calendar.allDay') : formatDateTime(ev.start_datetime) - + (ev.end_datetime ? ` – ${formatTime(ev.end_datetime)} Uhr` : ''); + + (ev.end_datetime ? ` – ${formatTime(ev.end_datetime)}${t('calendar.timeSuffix') ? ' ' + t('calendar.timeSuffix') : ''}`.trim() : ''); popup.innerHTML = `
diff --git a/public/pages/dashboard.js b/public/pages/dashboard.js index 6200145..e43655a 100644 --- a/public/pages/dashboard.js +++ b/public/pages/dashboard.js @@ -35,7 +35,8 @@ function formatDateTime(isoString) { : formatDate(d); const timeStr = formatTime(d); - return `${dateStr}, ${timeStr} Uhr`; + const suffix = t('calendar.timeSuffix'); + return `${dateStr}, ${timeStr}${suffix ? ' ' + suffix : ''}`.trim(); } function formatDueDate(dateStr) { @@ -191,7 +192,8 @@ function renderUpcomingEvents(events) { const items = events.map((e) => { const d = new Date(e.start_datetime); const isToday = d.toDateString() === today; - const timeStr = e.all_day ? t('dashboard.allDay') : formatTime(d) + ' Uhr'; + const _suffix = t('calendar.timeSuffix'); + const timeStr = e.all_day ? t('dashboard.allDay') : `${formatTime(d)}${_suffix ? ' ' + _suffix : ''}`.trim(); return `