fleetmap-reports 1.0.600 → 1.0.602

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": "1.0.600",
3
+ "version": "1.0.602",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -66,7 +66,8 @@ function processDevices (from, to, devices, data, userData) {
66
66
  }
67
67
  }
68
68
 
69
- stop.stopDuration = ((new Date(stop.endTime) - new Date(stop.startTime)) - stop.engineHours)
69
+ const totalStopTime = new Date(stop.endTime) - new Date(stop.startTime)
70
+ stop.stopDuration = totalStopTime > stop.engineHours ? (totalStopTime - stop.engineHours) : 0
70
71
  })
71
72
 
72
73
  if (deviceStops.length > 0) {
@@ -5,6 +5,7 @@ const utils = require('../util/utils')
5
5
 
6
6
  // eslint-disable-next-line no-undef
7
7
  describe('Test_Reports', function () {
8
+ this.timeout(5000000)
8
9
  it('converts to pdf', async () => {
9
10
  const report = await getReports()
10
11
  const userData = await report.getUserData()
package/src/util/utils.js CHANGED
@@ -18,7 +18,7 @@ exports.getLanguage = (userData) => {
18
18
 
19
19
  function convertMS (duration, withSeconds) {
20
20
  if (!duration || duration < 0) {
21
- return '00:00'
21
+ return withSeconds ? '00:00:00' : '00:00'
22
22
  }
23
23
 
24
24
  const ms = duration % 1000