From 4c03de63a37206cdb4c04254969f84bc4994066c Mon Sep 17 00:00:00 2001 From: Craig Kochis Date: Tue, 16 Jan 2024 11:03:51 -0500 Subject: [PATCH] add back remove timeZone param (#146) --- README.md | 14 +++++++------- package-lock.json | 2 +- package.json | 2 +- src/api/track.ts | 8 ++++++++ src/version.ts | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 16d6eb4f..761a1fde 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ }); Add the following script in your `html` file ```html - + ``` Then initialize the Radar SDK @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then ```html - - + + @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis ```html - - + + @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper ```html - - + + diff --git a/package-lock.json b/package-lock.json index 3a63f069..81793099 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.1.14", + "version": "4.1.15", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 1a25bf30..dd9c02b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.1.14", + "version": "4.1.15", "description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.", "homepage": "https://radar.com", "type": "module", diff --git a/src/api/track.ts b/src/api/track.ts index c3202bc8..6187eeff 100644 --- a/src/api/track.ts +++ b/src/api/track.ts @@ -42,6 +42,13 @@ class TrackAPI { const deviceType = params.deviceType || 'Web'; const description = params.description || Storage.getItem(Storage.DESCRIPTION); + let timeZone; + try { + timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; + } catch (err: any) { + Logger.warn(`Error getting time zone: ${err.message}`); + } + // save userId for trip tracking if (!userId) { Logger.warn('userId not provided for trackOnce.'); @@ -75,6 +82,7 @@ class TrackAPI { stopped: true, userId, tripOptions, + timeZone, }; const response: any = await Http.request({ diff --git a/src/version.ts b/src/version.ts index 0e27c146..93b41359 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '4.1.14'; +export default '4.1.15';