The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix timezone
Steven Tey4bc632c0759f
diff --git a/apps/web/lib/webhook/schemas.ts b/apps/web/lib/webhook/schemas.tsindex 423a753345..712f2dc8a4 100644--- a/apps/web/lib/webhook/schemas.ts+++ b/apps/web/lib/webhook/schemas.ts@@ -77,7 +77,7 @@ export const webhookPayloadSchema = z.object({.describe("The type of event that triggered the webhook."),createdAt: z.string()- .describe("The date and time when the event was created."),+ .describe("The date and time when the event was created in UTC."),data: z.union([linkEventSchema,clickEventSchema,diff --git a/apps/web/ui/webhooks/webhook-events.tsx b/apps/web/ui/webhooks/webhook-events.tsxindex a01a85d2f8..223a9822a9 100644--- a/apps/web/ui/webhooks/webhook-events.tsx+++ b/apps/web/ui/webhooks/webhook-events.tsx@@ -75,7 +75,13 @@ const WebhookEvent = ({ event }: { event: WebhookEventProps }) => {</div><div className="text-xs text-gray-400">- {new Date(event.timestamp).toLocaleString()}+ {(() => {+ const date = new Date(event.timestamp);+ const localDate = new Date(+ date.getTime() - date.getTimezoneOffset() * 60000,+ );+ return localDate.toLocaleString();+ })()}</div></button></SheetTrigger>