fix(business-profile): use the app-standard de-DE lang hint for 24h time
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 <input> for column alignment.
This commit is contained in:
@@ -3829,6 +3829,8 @@
|
|||||||
"addHours": "Zeiten hinzufügen",
|
"addHours": "Zeiten hinzufügen",
|
||||||
"addBlock": "Weiteren Block hinzufügen",
|
"addBlock": "Weiteren Block hinzufügen",
|
||||||
"copyToAll": "Auf alle Tage übertragen",
|
"copyToAll": "Auf alle Tage übertragen",
|
||||||
|
"startTime": "Öffnungszeit",
|
||||||
|
"endTime": "Schließzeit",
|
||||||
"floorToggle": "Geplante E-Mails bis zu den Geschäftszeiten zurückhalten",
|
"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.",
|
"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": {
|
"weekday": {
|
||||||
|
|||||||
@@ -3827,6 +3827,8 @@
|
|||||||
"addHours": "Add hours",
|
"addHours": "Add hours",
|
||||||
"addBlock": "Add another block",
|
"addBlock": "Add another block",
|
||||||
"copyToAll": "Copy to all days",
|
"copyToAll": "Copy to all days",
|
||||||
|
"startTime": "Opening time",
|
||||||
|
"endTime": "Closing time",
|
||||||
"floorToggle": "Hold scheduled emails until business hours",
|
"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.",
|
"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": {
|
"weekday": {
|
||||||
|
|||||||
@@ -356,12 +356,11 @@ const BusinessHoursEditor: React.FC<{
|
|||||||
}> = ({ value, onChange }) => {
|
}> = ({ value, onChange }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { timeFormat } = useLocalizedDate();
|
const { timeFormat } = useLocalizedDate();
|
||||||
// A native <input type="time"> renders 12h (AM/PM) or 24h purely from the
|
// Same `lang`-hint approach the rest of the app uses for time pickers
|
||||||
// browser/OS locale — it ignores our `general_time_format` setting. Pin a
|
// (HoursSection / Quote / Bill / Contract editors): de-DE → 24h, en-US → 12h.
|
||||||
// `lang` hint so Chrome/Edge render the admin's chosen format. (Safari /
|
// Chrome/Edge honour it; Safari/Firefox follow OS locale (browser limit).
|
||||||
// Firefox follow the OS locale regardless — same caveat as date inputs.)
|
// The stored value is always 24h "HH:MM".
|
||||||
// The stored value is always 24h "HH:MM" either way, so this is display-only.
|
const timeInputLang = timeFormat === '12h' ? 'en-US' : 'de-DE';
|
||||||
const timeInputLang = timeFormat === '12h' ? 'en-US' : 'en-GB';
|
|
||||||
|
|
||||||
// Always work with a fully-populated 7-day object so toggling a day on
|
// Always work with a fully-populated 7-day object so toggling a day on
|
||||||
// and off doesn't drop sibling keys.
|
// and off doesn't drop sibling keys.
|
||||||
@@ -433,17 +432,15 @@ const BusinessHoursEditor: React.FC<{
|
|||||||
|
|
||||||
{blocks.map((block, idx) => (
|
{blocks.map((block, idx) => (
|
||||||
<div key={idx} className="flex items-center gap-2">
|
<div key={idx} className="flex items-center gap-2">
|
||||||
{/* Plain <input>, NOT the shared <Input> — that one wraps
|
{/* Plain <input>, NOT the shared <Input> (its w-full
|
||||||
the field in a w-full div, so two of them in a flex row
|
wrapper makes two-per-row split + misalign with the
|
||||||
split the width and the trailing +/trash buttons shift
|
trailing buttons). Fixed width keeps columns aligned. */}
|
||||||
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. */}
|
|
||||||
<input
|
<input
|
||||||
type="time"
|
type="time"
|
||||||
lang={timeInputLang}
|
lang={timeInputLang}
|
||||||
value={block.start}
|
value={block.start}
|
||||||
onChange={(e) => updateBlock(iso, idx, { start: e.target.value })}
|
onChange={(e) => updateBlock(iso, idx, { start: e.target.value })}
|
||||||
|
aria-label={t('businessProfile.businessHours.startTime', 'Opening time') as string}
|
||||||
className="input w-32 shrink-0"
|
className="input w-32 shrink-0"
|
||||||
/>
|
/>
|
||||||
<span className="text-neutral-400">–</span>
|
<span className="text-neutral-400">–</span>
|
||||||
@@ -452,6 +449,7 @@ const BusinessHoursEditor: React.FC<{
|
|||||||
lang={timeInputLang}
|
lang={timeInputLang}
|
||||||
value={block.end}
|
value={block.end}
|
||||||
onChange={(e) => updateBlock(iso, idx, { end: e.target.value })}
|
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"
|
className="input w-32 shrink-0"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user