fleetmap-reports 1.0.456 → 1.0.457
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/trip-report.js +2 -1
package/package.json
CHANGED
package/src/trip-report.js
CHANGED
|
@@ -134,7 +134,6 @@ async function createTripReportByDriver (from, to, userData, traccar) {
|
|
|
134
134
|
d.totalDuration = d.trips.reduce((a, b) => a + b.duration, 0)
|
|
135
135
|
d.totalDistance = d.trips.reduce((a, b) => a + b.distance, 0)
|
|
136
136
|
d.maxSpeed = d.trips.reduce((a, b) => { return a > b.maxSpeed ? a : b.maxSpeed }, 0)
|
|
137
|
-
d.trips = d.trips.sort((a, b) => new Date(a.startTime).getTime() - new Date(b.startTime).getTime())
|
|
138
137
|
})
|
|
139
138
|
|
|
140
139
|
return report
|
|
@@ -215,6 +214,8 @@ function processDrivers (from, to, userData, data) {
|
|
|
215
214
|
const trips = data.trips.filter(t => t.driverUniqueId === d.uniqueId &&
|
|
216
215
|
(userData.allWeek || !userData.weekDays || isInsideTimetable(t, userData) || isPartialInsideTimetable(t, userData, route)))
|
|
217
216
|
|
|
217
|
+
trips.sort((a, b) => new Date(a.startTime).getTime() - new Date(b.startTime).getTime())
|
|
218
|
+
|
|
218
219
|
const idleEvents = getIdleEvents(data.route, d)
|
|
219
220
|
|
|
220
221
|
trips.forEach(function (trip, i) {
|