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]>
23 lines
729 B
TypeScript
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,
|
|
};
|
|
};
|