fleetmap-reports 2.0.333 → 2.0.334
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/sensor-report.js +2 -1
package/package.json
CHANGED
package/src/sensor-report.js
CHANGED
|
@@ -88,6 +88,7 @@ function computeSensorPeriods (positions, sensors, d, userData) {
|
|
|
88
88
|
const prevPos = positions[i - 1]
|
|
89
89
|
const currPos = positions[i]
|
|
90
90
|
const changeTime = new Date(currPos.fixTime)
|
|
91
|
+
const endTime = new Date(prevPos.fixTime)
|
|
91
92
|
|
|
92
93
|
for (const s of sensors) {
|
|
93
94
|
const key = s.sensor
|
|
@@ -97,7 +98,7 @@ function computeSensorPeriods (positions, sensors, d, userData) {
|
|
|
97
98
|
if (prevValue === newValue) continue
|
|
98
99
|
|
|
99
100
|
const oldStartTime = current[key].startTime
|
|
100
|
-
const prevEndTime =
|
|
101
|
+
const prevEndTime = endTime
|
|
101
102
|
const duration = prevEndTime - oldStartTime
|
|
102
103
|
const threshold = minThreshold(prevValue)
|
|
103
104
|
let newPeriodStartTime = changeTime
|