fleetmap-reports 1.0.664 → 1.0.665
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 +12 -0
package/package.json
CHANGED
package/src/zone-report.js
CHANGED
|
@@ -262,6 +262,18 @@ function analyseAlertsGroupGeofences (alerts, deviceRoute, from, to) {
|
|
|
262
262
|
totalTime: totalInTime
|
|
263
263
|
})
|
|
264
264
|
}
|
|
265
|
+
|
|
266
|
+
if (zoneInOutData.length > 0) {
|
|
267
|
+
if (zoneInOutData[0].inTime) {
|
|
268
|
+
// Add distanceOut before the first entry
|
|
269
|
+
const routeOut = deviceRoute.filter(p =>
|
|
270
|
+
new Date(p.fixTime).getTime() < new Date(zoneInOutData[0].inTime.fixTime).getTime() &&
|
|
271
|
+
new Date(p.fixTime).getTime() <= to.getTime()
|
|
272
|
+
)
|
|
273
|
+
zoneInOutData[0].distanceOut = calculateDistance(routeOut)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
265
277
|
return zoneInOutData
|
|
266
278
|
}
|
|
267
279
|
|