From cf3b96bfeea95adab5346a5bd234b88f98b3a70e Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Tue, 29 Oct 2024 19:20:37 +0000 Subject: [PATCH] Add timezone to events --- src/utils/event-utils.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utils/event-utils.ts b/src/utils/event-utils.ts index e7d1d1acd..3f12553a7 100644 --- a/src/utils/event-utils.ts +++ b/src/utils/event-utils.ts @@ -182,6 +182,14 @@ export const Info = { return props }, + timezone: function (): string | undefined { + try { + return Intl.DateTimeFormat().resolvedOptions().timeZone + } catch { + return undefined + } + }, + properties: function (): Properties { if (!userAgent) { return {} @@ -194,6 +202,7 @@ export const Info = { $browser: Info.browser(userAgent, navigator.vendor), $device: Info.device(userAgent), $device_type: Info.deviceType(userAgent), + $timezone: Info.timezone(), }), { $current_url: location?.href,