hunk.code_window: APP_ROUTER_WORKFLOWS_ENABLED=0
   APP_ROUTER_SETTINGS_TEAMS_ENABLED=0
   APP_ROUTER_GETTING_STARTED_STEP_ENABLED=0
   APP_ROUTER_APPS_ENABLED=0
   APP_ROUTER_VIDEO_ENABLED=0
  
hunk.labels: keep keep keep keep add
hunk.after_edit: # disable setry server source maps
   SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN=1
  
hunk.file_path: .env.example
hunk.type: add
file: import { create } from "zustand";
  
  import dayjs from "@calcom/dayjs";
  import { TimeFormat, detectBrowserTimeFormat, setIs24hClockInLocalStorage } from "@calcom/lib/timeFormat";
  import { localStorage } from "@calcom/lib/webstorage";
  
  type TimePreferencesStore = {
    timeFormat: TimeFormat.TWELVE_HOUR | TimeFormat.TWENTY_FOUR_HOUR;
    setTimeFormat: (format: TimeFormat.TWELVE_HOUR | TimeFormat.TWENTY_FOUR_HOUR) => void;
    timezone: string;
    setTimezone: (timeZone: string) => void;
  };
  
  const timezoneLocalStorageKey = "timeOption.preferredTimeZone";
  
  /**
   * This hook is NOT inside the user feature, since
   * these settings only apply to the booker component. They will not reflect
   * any changes made in the user settings.
   */
  export const timePreferencesStore = create<TimePreferencesStore>((set) => ({
    timeFormat: detectBrowserTimeFormat,
    setTimeFormat: (format: TimeFormat.TWELVE_HOUR | TimeFormat.TWENTY_FOUR_HOUR) => {
      setIs24hClockInLocalStorage(format === TimeFormat.TWENTY_FOUR_HOUR);
      set({ timeFormat: format });
    },
    timezone: localStorage.getItem(timezoneLocalStorageKey) || dayjs.tz.guess() || "Europe/London",
    setTimezone: (timezone: string) => {
      localStorage.setItem(timezoneLocalStorageKey, timezone);
      set({ timezone });
    },
  }));
  
  export const useTimePreferences = timePreferencesStore;
  