fleetmap-reports 2.0.338 → 2.0.339
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 -2
package/package.json
CHANGED
package/src/sensor-report.js
CHANGED
|
@@ -98,9 +98,9 @@ function computeSensorPeriods (positions, sensors, d, userData) {
|
|
|
98
98
|
const oldStartTime = current[key].startTime
|
|
99
99
|
const gap = changeTime - new Date(prevPos.fixTime)
|
|
100
100
|
if (gap > maxDistanceBetweenPositions) {
|
|
101
|
-
const prevEndTime = new Date(prevPos.fixTime)
|
|
101
|
+
const prevEndTime = prevValue ? new Date(prevPos.fixTime) : changeTime
|
|
102
102
|
const duration = prevEndTime - oldStartTime
|
|
103
|
-
const threshold = minThreshold(
|
|
103
|
+
const threshold = minThreshold(prevValue)
|
|
104
104
|
|
|
105
105
|
if (duration >= threshold) {
|
|
106
106
|
pushPeriod(key, s, prevValue, oldStartTime, prevEndTime, prevPos)
|