Skip to content

Commit

Permalink
Minor change: timestamp is now an iso8601
Browse files Browse the repository at this point in the history
  • Loading branch information
aud committed Mar 5, 2024
1 parent 71edab9 commit deee1d9
Show file tree
Hide file tree
Showing 7 changed files with 2,794 additions and 3,269 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/
node_modules
14 changes: 7 additions & 7 deletions dist/dexcom-share-api.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ var Trend;
})(Trend || (Trend = {}));
const fetch = typeof window !== "undefined" ? window.fetch : require("isomorphic-fetch");
class DexcomClient {
static get APPLICATION_ID() {
return "d8665ade-9673-4e27-9ff6-92db4ce13d13";
}
static get DEXCOM_SERVERS() {
return ["eu", "us"];
}
constructor({ username, password, server } = {
username: void 0,
password: void 0,
Expand Down Expand Up @@ -53,12 +59,6 @@ class DexcomClient {
this.password = password;
this.server = server;
}
static get APPLICATION_ID() {
return "d8665ade-9673-4e27-9ff6-92db4ce13d13";
}
static get DEXCOM_SERVERS() {
return ["eu", "us"];
}
async getAccountId() {
try {
const result = await fetch(this.apiUrl("General/AuthenticatePublisherAccount"), {
Expand Down Expand Up @@ -131,7 +131,7 @@ class DexcomClient {
mmol: mgdlToMmol(entry.Value),
mgdl: entry.Value,
trend: trend.toLowerCase(),
timestamp: new Date(extractNumber(entry.WT)).getTime()
timestamp: new Date(extractNumber(entry.WT)).toISOString()
};
});
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion dist/dexcom-share-api.umd.js

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": "dexcom-share-api",
"version": "1.0.9",
"version": "1.1.0",
"files": [
"dist"
],
Expand Down
4 changes: 2 additions & 2 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe("DexcomClient", () => {
{
mgdl: 185,
mmol: 10.28,
timestamp: 1640812425000,
timestamp: "2021-12-29T21:13:45.000Z",
trend: "flat",
}
]
Expand Down Expand Up @@ -270,7 +270,7 @@ describe("DexcomClient", () => {
{
mgdl: 185,
mmol: 10.28,
timestamp: 1640812425000,
timestamp: "2021-12-29T21:13:45.000Z",
trend: "doubleup",
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class DexcomClient {
mmol: mgdlToMmol(entry.Value),
mgdl: entry.Value,
trend: trend.toLowerCase(),
timestamp: new Date(extractNumber(entry.WT) as number).getTime(),
timestamp: new Date(extractNumber(entry.WT) as number).toISOString(),
}
});
} catch(err) {
Expand Down
Loading

0 comments on commit deee1d9

Please sign in to comment.