Files
cal.diy/packages/features/bookings/Booker/components/hooks/useBookerTime.ts
T
821a16648f fix: Timezone in Email Embed not working #15525 (#15537)
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Amit Sharma <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Hariom <[email protected]>
2025-01-03 08:43:09 +00:00

23 lines
729 B
TypeScript

import { shallow } from "zustand/shallow";
import { useBookerStore } from "@calcom/features/bookings/Booker/store";
import { useTimePreferences } from "../../../lib/timePreferences";
import { getBookerTimezone } from "../../utils/getBookerTimezone";
export const useBookerTime = () => {
const [timezoneFromBookerStore] = useBookerStore((state) => [state.timezone], shallow);
const { timezone: timezoneFromTimePreferences, timeFormat } = useTimePreferences();
const timezone = getBookerTimezone({
storeTimezone: timezoneFromBookerStore,
bookerUserPreferredTimezone: timezoneFromTimePreferences,
});
return {
timezone,
timeFormat,
timezoneFromBookerStore,
timezoneFromTimePreferences,
};
};