Co-authored-by: Keith Williams <keithwillcode@gmail.com> Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Hariom <hariombalhara@gmail.com>
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;
|
|
};
|