diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json index 571f3b79..9777c510 100644 --- a/frontend/src/i18n/locales/de.json +++ b/frontend/src/i18n/locales/de.json @@ -3829,6 +3829,8 @@ "addHours": "Zeiten hinzufügen", "addBlock": "Weiteren Block hinzufügen", "copyToAll": "Auf alle Tage übertragen", + "startTime": "Öffnungszeit", + "endTime": "Schließzeit", "floorToggle": "Geplante E-Mails bis zu den Geschäftszeiten zurückhalten", "floorToggleHelp": "Wenn aktiv, wird eine automatische E-Mail, die außerhalb der obigen Zeiten geplant ist, erst zur nächsten Öffnungszeit zugestellt statt zu einer ungünstigen Uhrzeit. Wenn aus, werden geplante E-Mails exakt zum geplanten Zeitpunkt versendet.", "weekday": { diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 4a9081d5..0b8d1f1f 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -3827,6 +3827,8 @@ "addHours": "Add hours", "addBlock": "Add another block", "copyToAll": "Copy to all days", + "startTime": "Opening time", + "endTime": "Closing time", "floorToggle": "Hold scheduled emails until business hours", "floorToggleHelp": "When on, an automated email scheduled outside the hours above is delivered at the next opening instead of at an odd hour. When off, scheduled emails send at their exact time.", "weekday": { diff --git a/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx b/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx index d813b688..b83fe91d 100644 --- a/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx +++ b/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx @@ -356,12 +356,11 @@ const BusinessHoursEditor: React.FC<{ }> = ({ value, onChange }) => { const { t } = useTranslation(); const { timeFormat } = useLocalizedDate(); - // A native renders 12h (AM/PM) or 24h purely from the - // browser/OS locale — it ignores our `general_time_format` setting. Pin a - // `lang` hint so Chrome/Edge render the admin's chosen format. (Safari / - // Firefox follow the OS locale regardless — same caveat as date inputs.) - // The stored value is always 24h "HH:MM" either way, so this is display-only. - const timeInputLang = timeFormat === '12h' ? 'en-US' : 'en-GB'; + // Same `lang`-hint approach the rest of the app uses for time pickers + // (HoursSection / Quote / Bill / Contract editors): de-DE → 24h, en-US → 12h. + // Chrome/Edge honour it; Safari/Firefox follow OS locale (browser limit). + // The stored value is always 24h "HH:MM". + const timeInputLang = timeFormat === '12h' ? 'en-US' : 'de-DE'; // Always work with a fully-populated 7-day object so toggling a day on // and off doesn't drop sibling keys. @@ -433,17 +432,15 @@ const BusinessHoursEditor: React.FC<{ {blocks.map((block, idx) => (
- {/* Plain , NOT the shared — that one wraps - the field in a w-full div, so two of them in a flex row - split the width and the trailing +/trash buttons shift - the columns out of alignment. Fixed-width + shrink-0 - keeps every block's start/end columns lined up. The - `input` class carries the shared field styling. */} + {/* Plain , NOT the shared (its w-full + wrapper makes two-per-row split + misalign with the + trailing buttons). Fixed width keeps columns aligned. */} updateBlock(iso, idx, { start: e.target.value })} + aria-label={t('businessProfile.businessHours.startTime', 'Opening time') as string} className="input w-32 shrink-0" /> @@ -452,6 +449,7 @@ const BusinessHoursEditor: React.FC<{ lang={timeInputLang} value={block.end} onChange={(e) => updateBlock(iso, idx, { end: e.target.value })} + aria-label={t('businessProfile.businessHours.endTime', 'Closing time') as string} className="input w-32 shrink-0" />