fleetmap-reports 1.0.996 → 1.0.998

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.996",
3
+ "version": "1.0.998",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -268,7 +268,7 @@ async function processDrivers (from, to, userData, data) {
268
268
  }
269
269
 
270
270
  for (const d of userData.drivers) {
271
- const { trips } = getDriverData(d, data)
271
+ const { trips } = await getDriverData(d, data, userData)
272
272
 
273
273
  if (trips) {
274
274
  trips.forEach(trip => {
@@ -135,13 +135,13 @@ async function getSummaryByDay (dates, userData, traccarInstance, allDevices, ig
135
135
  for (const [index, date] of dates.entries()) {
136
136
  let startDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + userData.dayHours.startTime)
137
137
  if (index === 0) {
138
- const _startDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + from.toTimeString())
138
+ const _startDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + from.toTimeString().slice(0, 8))
139
139
  startDateLocal = startDateLocal.getTime() > _startDateLocal.getTime() ? startDateLocal : _startDateLocal
140
140
  }
141
141
 
142
142
  let endDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + userData.dayHours.endTime)
143
143
  if (index === dates.length - 1) {
144
- const _endDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + to.toTimeString())
144
+ const _endDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + to.toTimeString().slice(0, 8))
145
145
  endDateLocal = endDateLocal.getTime() < _endDateLocal.getTime() ? endDateLocal : _endDateLocal
146
146
  }
147
147