mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
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]>
15 lines
637 B
TypeScript
15 lines
637 B
TypeScript
/**
|
|
* TODO: We could convert it into a hook and then we can access bookerStore and timePreferences stores directly here, avoiding the need to do it by the caller
|
|
*/
|
|
export const getBookerTimezone = ({
|
|
storeTimezone,
|
|
bookerUserPreferredTimezone,
|
|
}: {
|
|
storeTimezone: string | null;
|
|
bookerUserPreferredTimezone: string;
|
|
}) => {
|
|
// BookerStore timezone is the one that is updated no matter what could be the reason of the update
|
|
// e.g. timezone configured through cal.tz query param is available there but not in the preferences as those are booker user's preferences
|
|
return storeTimezone ?? bookerUserPreferredTimezone;
|
|
};
|