fleetmap-reports 2.0.332 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "2.0.332",
3
+ "version": "2.0.334",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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 = changeTime
101
+ const prevEndTime = endTime
101
102
  const duration = prevEndTime - oldStartTime
102
103
  const threshold = minThreshold(prevValue)
103
104
  let newPeriodStartTime = changeTime
@@ -597,7 +597,7 @@ function exportSpeedingReportToExcel (userData, reportData) {
597
597
  overspeedData.forEach(d => {
598
598
  data = data.concat([{}])
599
599
  data = data.concat(d.alerts.map(a => {
600
- const group = userData.groups.find(g => g.id === d.groupId)
600
+ const group = userData.groups.find(g => g.id === d.device.groupId)
601
601
  return {
602
602
  groupName: group ? group.name : '',
603
603
  driver: userData.byDriver ? d.driver.name : a.driver,