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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.662",
3
+ "version": "1.0.663",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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.findLast(z => new Date(z.outTime.fixTime) < toByDay)
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