Statusphere running on a slice 馃崟
1export function getUserTimezone(req: Request): string | undefined {
2 const cookieHeader = req.headers.get("cookie") || "";
3 const timezoneCookie = cookieHeader.split("; ").find(row => row.startsWith("timezone="));
4 return timezoneCookie ? decodeURIComponent(timezoneCookie.split("=")[1]) : undefined;
5}