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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "2.0.338",
3
+ "version": "2.0.339",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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(true)
103
+ const threshold = minThreshold(prevValue)
104
104
 
105
105
  if (duration >= threshold) {
106
106
  pushPeriod(key, s, prevValue, oldStartTime, prevEndTime, prevPos)