Skip to content

Commit

Permalink
feat: Add timezone to events (#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c authored Oct 30, 2024
1 parent 192e6c2 commit ce93acd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils/event-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand All @@ -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,
Expand Down

0 comments on commit ce93acd

Please sign in to comment.