Skip to content

Commit

Permalink
add back remove timeZone param (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
kochis authored Jan 16, 2024
1 parent 61741d5 commit 4c03de6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ });
Add the following script in your `html` file
```html
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
<script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
```

Then initialize the Radar SDK
Expand All @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.15/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
</head>

<body>
Expand All @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.15/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
</head>

<body>
Expand Down Expand Up @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.15/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.15/radar.min.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions src/api/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down Expand Up @@ -75,6 +82,7 @@ class TrackAPI {
stopped: true,
userId,
tripOptions,
timeZone,
};

const response: any = await Http.request({
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '4.1.14';
export default '4.1.15';

0 comments on commit 4c03de6

Please sign in to comment.