Fix time format on booking page (#5006)

Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
Joe Au-YeungandPeer Richelsen authored and GitHub committed 2022-10-14 19:15:03 +00:00
1 parent ff01da540d
commit c4f3dec854
3 files changed
+10 -10

No files matched your search

+5 -3
View File
@@ -28,9 +28,11 @@ export const isBrowserLocale24h = () => {
}
let locale = "en-US";
if (typeof window !== "undefined" && navigator) locale = window.navigator?.language;
if (typeof window !== "undefined" && navigator) {
locale = window.navigator?.language;
}
if (!new Intl.DateTimeFormat(locale, { hour: "numeric" }).format(0).match(/M/)) {
if (!!new Intl.DateTimeFormat(locale, { hour: "numeric" }).format(0).match(/M/i)) {
setIs24hClockInLocalStorage(false);
return false;
} else {
@@ -39,4 +41,4 @@ export const isBrowserLocale24h = () => {
}
};
export const detectBrowserTimeFormat = isBrowserLocale24h() ? "H:mm" : "h:mma";
export const detectBrowserTimeFormat = isBrowserLocale24h() ? "HH:mm" : "h:mma";