fleetmap-reports 1.0.260 → 1.0.261

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.
@@ -1,16 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
- <list default="true" id="eb665c86-c893-4333-bd2a-721dc27980b9" name="Changes" comment="location report - check if it's running on client side">
4
+ <list default="true" id="eb665c86-c893-4333-bd2a-721dc27980b9" name="Changes" comment="timezone - check if it's running on client side">
5
5
  <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
6
6
  <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
7
- <change beforePath="$PROJECT_DIR$/src/events-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/events-report.js" afterDir="false" />
8
7
  <change beforePath="$PROJECT_DIR$/src/index.test.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.test.js" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/src/location-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/location-report.js" afterDir="false" />
10
- <change beforePath="$PROJECT_DIR$/src/speeding-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/speeding-report.js" afterDir="false" />
11
8
  <change beforePath="$PROJECT_DIR$/src/trip-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/trip-report.js" afterDir="false" />
12
- <change beforePath="$PROJECT_DIR$/src/util/utils.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/util/utils.js" afterDir="false" />
13
- <change beforePath="$PROJECT_DIR$/src/zone-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/zone-report.js" afterDir="false" />
14
9
  </list>
15
10
  <option name="SHOW_DIALOG" value="false" />
16
11
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -220,7 +215,10 @@
220
215
  <workItem from="1639954341221" duration="11986000" />
221
216
  <workItem from="1640272520380" duration="2253000" />
222
217
  <workItem from="1640789226071" duration="1935000" />
223
- <workItem from="1640794844118" duration="8847000" />
218
+ <workItem from="1640794844118" duration="10128000" />
219
+ <workItem from="1640866364417" duration="67000" />
220
+ <workItem from="1640866782794" duration="123000" />
221
+ <workItem from="1640866964393" duration="478000" />
224
222
  </task>
225
223
  <task id="LOCAL-00001" summary="Fix getStyle">
226
224
  <created>1636983717385</created>
@@ -341,7 +339,14 @@
341
339
  <option name="project" value="LOCAL" />
342
340
  <updated>1640795243288</updated>
343
341
  </task>
344
- <option name="localTasksCounter" value="18" />
342
+ <task id="LOCAL-00018" summary="timezone - check if it's running on client side">
343
+ <created>1640825795052</created>
344
+ <option name="number" value="00018" />
345
+ <option name="presentableId" value="LOCAL-00018" />
346
+ <option name="project" value="LOCAL" />
347
+ <updated>1640825795053</updated>
348
+ </task>
349
+ <option name="localTasksCounter" value="19" />
345
350
  <servers />
346
351
  </component>
347
352
  <component name="TypeScriptGeneratedFilesManager">
@@ -376,6 +381,7 @@
376
381
  <MESSAGE value="Fix trips distance because imported positions generate trips with 0 kms" />
377
382
  <MESSAGE value="Fix reports by driver" />
378
383
  <MESSAGE value="location report - check if it's running on client side" />
379
- <option name="LAST_COMMIT_MESSAGE" value="location report - check if it's running on client side" />
384
+ <MESSAGE value="timezone - check if it's running on client side" />
385
+ <option name="LAST_COMMIT_MESSAGE" value="timezone - check if it's running on client side" />
380
386
  </component>
381
387
  </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.260",
3
+ "version": "1.0.261",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -430,7 +430,8 @@ function getSumAvgSpeed(data) {
430
430
  const values = data.map(item => {
431
431
  return Math.round(item.averageSpeed * 1.85200) * item.totalKms
432
432
  })
433
- return Math.round((values.reduce((a, b) => a + b, 0)) / data.reduce((a, b) => a + b.totalKms, 0))
433
+ const totalKms = data.reduce((a, b) => a + b.totalKms, 0)
434
+ return totalKms > 0 ? Math.round((values.reduce((a, b) => a + b, 0)) / totalKms) : 0
434
435
  }
435
436
 
436
437
  function getMaxSpeed(data) {