@teslemetry/api 0.6.11 → 0.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3384,12 +3384,20 @@ var TeslemetryChargingApi = class extends events.EventEmitter {
3384
3384
  //#endregion
3385
3385
  //#region src/dateHelper.ts
3386
3386
  /**
3387
- * Converts a Date object to ISO string format without milliseconds
3387
+ * Converts a Date object to RFC3339 format with local timezone offset
3388
3388
  * @param date The Date object to convert
3389
- * @returns ISO string with milliseconds removed (e.g., "2024-01-15T00:00:00Z")
3389
+ * @returns RFC3339 string with timezone offset (e.g., "2024-01-15T00:00:00+11:00")
3390
3390
  */
3391
3391
  function formatDate(date) {
3392
- return date.toISOString().replace(/\.\d{3}Z$/, "Z");
3392
+ const pad = (n, digits = 2) => String(n).padStart(digits, "0");
3393
+ const year = date.getFullYear();
3394
+ const month = pad(date.getMonth() + 1);
3395
+ const day = pad(date.getDate());
3396
+ const hours = pad(date.getHours());
3397
+ const minutes = pad(date.getMinutes());
3398
+ const seconds = pad(date.getSeconds());
3399
+ const tzOffset = -date.getTimezoneOffset();
3400
+ return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}${tzOffset >= 0 ? "+" : "-"}${pad(Math.floor(Math.abs(tzOffset) / 60))}:${pad(Math.abs(tzOffset) % 60)}`;
3393
3401
  }
3394
3402
  /**
3395
3403
  * Gets the start of today (midnight) in local timezone
@@ -5253,7 +5261,7 @@ const consoleLogger = {
5253
5261
 
5254
5262
  //#endregion
5255
5263
  //#region package.json
5256
- var version = "0.6.11";
5264
+ var version = "0.6.12";
5257
5265
 
5258
5266
  //#endregion
5259
5267
  //#region src/Teslemetry.ts
package/dist/index.mjs CHANGED
@@ -3384,12 +3384,20 @@ var TeslemetryChargingApi = class extends EventEmitter {
3384
3384
  //#endregion
3385
3385
  //#region src/dateHelper.ts
3386
3386
  /**
3387
- * Converts a Date object to ISO string format without milliseconds
3387
+ * Converts a Date object to RFC3339 format with local timezone offset
3388
3388
  * @param date The Date object to convert
3389
- * @returns ISO string with milliseconds removed (e.g., "2024-01-15T00:00:00Z")
3389
+ * @returns RFC3339 string with timezone offset (e.g., "2024-01-15T00:00:00+11:00")
3390
3390
  */
3391
3391
  function formatDate(date) {
3392
- return date.toISOString().replace(/\.\d{3}Z$/, "Z");
3392
+ const pad = (n, digits = 2) => String(n).padStart(digits, "0");
3393
+ const year = date.getFullYear();
3394
+ const month = pad(date.getMonth() + 1);
3395
+ const day = pad(date.getDate());
3396
+ const hours = pad(date.getHours());
3397
+ const minutes = pad(date.getMinutes());
3398
+ const seconds = pad(date.getSeconds());
3399
+ const tzOffset = -date.getTimezoneOffset();
3400
+ return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}${tzOffset >= 0 ? "+" : "-"}${pad(Math.floor(Math.abs(tzOffset) / 60))}:${pad(Math.abs(tzOffset) % 60)}`;
3393
3401
  }
3394
3402
  /**
3395
3403
  * Gets the start of today (midnight) in local timezone
@@ -5253,7 +5261,7 @@ const consoleLogger = {
5253
5261
 
5254
5262
  //#endregion
5255
5263
  //#region package.json
5256
- var version = "0.6.11";
5264
+ var version = "0.6.12";
5257
5265
 
5258
5266
  //#endregion
5259
5267
  //#region src/Teslemetry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teslemetry/api",
3
- "version": "0.6.11",
3
+ "version": "0.6.12",
4
4
  "description": "API client for Teslemetry",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",