fleetmap-reports 2.0.173 → 2.0.174

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": "2.0.173",
3
+ "version": "2.0.174",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/util/trips.js CHANGED
@@ -133,7 +133,7 @@ function isInsideTimetable (t, userData) {
133
133
  function updateTrip (device, t, route) {
134
134
  route = route.filter(p => p && p.attributes.ignition)
135
135
  if (!route.length) { return }
136
- const distance = calculateDistance(route, device.attributes['report.ignoreOdometer']) * 1000
136
+ const distance = calculateDistance(route, true) * 1000
137
137
  t.distance = distance
138
138
  t.duration = new Date(route[route.length - 1].fixTime).getTime() - new Date(route[0].fixTime).getTime()
139
139
  t.maxSpeed = route.reduce((a, b) => Math.max(a, b.speed), 0)