From e1d9d06ae9bda82f2b6c915e8450787517abee95 Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Tue, 2 Jun 2026 16:36:46 +0200 Subject: [PATCH] fix(business-profile): use the app-standard de-DE lang hint for 24h time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Business-hours time pickers used lang="en-GB", which didn't render 24h in Chrome. Switch to lang={timeFormat==='12h'?'en-US':'de-DE'} — the same hint HoursSection/Quote/Bill/Contract editors use — so the picker shows 24h in Chrome/Edge. Keep the fixed-width plain for column alignment. --- frontend/src/i18n/locales/de.json | 2 ++ frontend/src/i18n/locales/en.json | 2 ++ .../settings/SettingsBusinessProfilePage.tsx | 22 +++++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) 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) => (