fleetmap-reports 1.0.662 → 1.0.663
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 +1 -1
- package/src/zone-report.js +1 -1
package/package.json
CHANGED
package/src/zone-report.js
CHANGED
|
@@ -116,7 +116,7 @@ async function processDevices (from, to, devices, userData, data) {
|
|
|
116
116
|
const zoneInOutDayData = resultSorted.filter(z => new Date(z.inTime.fixTime) < toByDay &&
|
|
117
117
|
new Date(z.outTime.fixTime) > fromByDay)
|
|
118
118
|
const firstIn = zoneInOutDayData.find(z => new Date(z.inTime.fixTime) > fromByDay)
|
|
119
|
-
const lastOut = zoneInOutDayData.
|
|
119
|
+
const lastOut = zoneInOutDayData.slice().reverse().find(z => new Date(z.outTime.fixTime) < toByDay)
|
|
120
120
|
|
|
121
121
|
let timeIn = zoneInOutDayData.length ? zoneInOutData.reduce((a, b) => a + (b.totalTime || 0), 0) * 1000 : 0
|
|
122
122
|
let distanceIn = zoneInOutDayData.length ? zoneInOutData.reduce((a, b) => a + (b.distanceIn || 0), 0) : 0
|