fleetmap-reports 1.0.632 → 1.0.633

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.632",
3
+ "version": "1.0.633",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -135,6 +135,7 @@ async function createTripReportByDriver (from, to, userData, traccar) {
135
135
  d.totalDuration = d.trips.reduce((a, b) => a + b.duration, 0)
136
136
  d.totalDistance = d.trips.reduce((a, b) => a + b.distance, 0)
137
137
  d.maxSpeed = d.trips.reduce((a, b) => { return a > b.maxSpeed ? a : b.maxSpeed }, 0)
138
+ d.trips.sort((a, b) => new Date(a.startTime).getTime() - new Date(b.startTime).getTime())
138
139
  })
139
140
 
140
141
  return report