fleetmap-reports 1.0.800 → 1.0.802
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/activity-report.js +2 -2
package/package.json
CHANGED
package/src/activity-report.js
CHANGED
|
@@ -166,7 +166,7 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
166
166
|
const toByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59)
|
|
167
167
|
|
|
168
168
|
const tripsByDay = trips.filter(t => (new Date(t.startTime) > fromByDay && new Date(t.endTime) < toByDay))
|
|
169
|
-
const routeByDay =
|
|
169
|
+
const routeByDay = deviceRoute.filter(p => (new Date(p.fixTime) > fromByDay && new Date(p.fixTime) < toByDay))
|
|
170
170
|
const distance = tripsByDay.reduce((a, b) => a + b.distance, 0)
|
|
171
171
|
|
|
172
172
|
if (!userData.allWeek && userData.weekDays && userData.dayHours) {
|
|
@@ -245,7 +245,7 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
245
245
|
summary
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
if ((deviceData.summary.length && deviceData.summary
|
|
248
|
+
if ((deviceData.summary.length && deviceData.summary.some(s => s.startTime)) || !userData.onlyWithActivity) {
|
|
249
249
|
devicesResult.push(deviceData)
|
|
250
250
|
}
|
|
251
251
|
})
|