···11import { Suspense } from "react";
22-import { headers } from "next/headers";
32import Link from "next/link";
4354import { Button } from "@openstatus/ui";
6576import { Tracker } from "@/components/tracker";
87import { getHomeMonitorListData } from "@/lib/tb";
99-1010-const currentTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
88+import { convertTimezoneToGMT } from "@/lib/timezone";
1191210export async function TrackerExample() {
1311 return (
···3634}
37353836async function ExampleTracker() {
3939- const headersList = headers();
4040- const timezone = headersList.get("x-vercel-ip-timezone") || currentTimezone;
4141- const data = await getHomeMonitorListData({ timezone });
3737+ const gmt = convertTimezoneToGMT();
3838+ const data = await getHomeMonitorListData({ timezone: gmt });
4239 if (!data) return null;
4340 return (
4441 <Tracker
···4744 name="Ping"
4845 context="play"
4946 url="https://www.openstatus.dev/api/ping"
5050- timezone={timezone}
5147 />
5248 );
5349}
+3-7
apps/web/src/components/status-page/monitor.tsx
···11-import { headers } from "next/headers";
21import type { z } from "zod";
3243import type {
···76} from "@openstatus/db/src/schema";
8798import { getMonitorListData } from "@/lib/tb";
99+import { convertTimezoneToGMT } from "@/lib/timezone";
1010import { Tracker } from "../tracker";
11111212-const currentTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
1313-1412export const Monitor = async ({
1513 monitor,
1614 statusReports,
···1816 monitor: z.infer<typeof selectPublicMonitorSchema>;
1917 statusReports: z.infer<typeof selectPublicStatusReportSchemaWithRelation>[];
2018}) => {
2121- const headersList = headers();
2222- const timezone = headersList.get("x-vercel-ip-timezone") || currentTimezone;
2323-1919+ const gmt = convertTimezoneToGMT();
2420 const data = await getMonitorListData({
2521 monitorId: String(monitor.id),
2626- timezone,
2222+ timezone: gmt,
2723 });
28242925 // TODO: we could handle the `statusReports` here instead of passing it down to the tracker
-1
apps/web/src/components/tracker.tsx
···5757 name: string;
5858 description?: string;
5959 context?: "play" | "status-page"; // TODO: we might need to extract those two different use cases - for now it's ok I'd say.
6060- timezone?: string;
6160 reports?: (StatusReport & { statusReportUpdates: StatusReportUpdate[] })[];
6261}
6362