fleetmap-reports 2.0.389 → 2.0.390

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "2.0.389",
3
+ "version": "2.0.390",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -200,8 +200,8 @@ async function processDevices (from, to, devices, data, userData, traccarInstanc
200
200
  maxSpeed: tripsByDay.reduce((a, b) => {
201
201
  return a > b.maxSpeed ? a : b.maxSpeed
202
202
  }, 0),
203
- endOdometer: 0,
204
- startOdometer: 0,
203
+ endOdometer: tripsByDay.length ? tripsByDay[tripsByDay.length - 1].endOdometer : 0,
204
+ startOdometer: tripsByDay.length ? tripsByDay[0].startOdometer : 0,
205
205
  startTime: tripsByDay.length && tripsByDay[0].startTime,
206
206
  startAddress: tripsByDay.length && tripsByDay[0].startAddress,
207
207
  endTime: tripsByDay.length && tripsByDay[tripsByDay.length - 1].endTime,