import { createCookie } from "@remix-run/node";

export const timezoneCookie = createCookie("timezone", {
  maxAge: 60 * 60 * 24 * 365,
  path: "/",
});

export const getTimezone = async (request: Request): Promise<string | undefined> => {
  const cookieValue = await timezoneCookie.parse(request.headers.get("Cookie") || "");
  return cookieValue || undefined;
};

