fleetmap-reports 1.0.884 → 1.0.886

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.884",
3
+ "version": "1.0.886",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -31,8 +31,8 @@ async function createDailyUseReport (from, to, userData, traccar) {
31
31
  }
32
32
 
33
33
  const morningTrips = deviceTrips.filter(t => isInsideTimetable(t, userData) || isPartialInsideTimetable(t, userData, deviceRoute))
34
- const morningStart = morningTrips.length && convertFromUTCDate(new Date(morningTrips[0].startTime, userData.user))
35
- const morningEnd = morningTrips.length && new Date(morningTrips[morningTrips.length - 1].endTime)
34
+ const morningStart = morningTrips.length && convertFromUTCDate(new Date(morningTrips[0].startTime), userData.user)
35
+ const morningEnd = morningTrips.length && convertFromUTCDate(new Date(morningTrips[morningTrips.length - 1].endTime), userData.user)
36
36
 
37
37
  userData.dayHours = {
38
38
  startTime: '12:00',
@@ -40,8 +40,9 @@ async function createDailyUseReport (from, to, userData, traccar) {
40
40
  }
41
41
 
42
42
  const afternoonTrips = deviceTrips.filter(t => isInsideTimetable(t, userData) || isPartialInsideTimetable(t, userData, deviceRoute))
43
- const afternoonStart = afternoonTrips.length && new Date(afternoonTrips[0].startTime)
44
- const afternoonEnd = afternoonTrips.length && new Date(afternoonTrips[afternoonTrips.length - 1].endTime)
43
+
44
+ const afternoonStart = afternoonTrips.length && convertFromUTCDate(new Date(afternoonTrips[0].startTime), userData.user)
45
+ const afternoonEnd = afternoonTrips.length && convertFromUTCDate(new Date(afternoonTrips[afternoonTrips.length - 1].endTime), userData.user)
45
46
 
46
47
  reportData.push({
47
48
  device: d.name,
@@ -316,6 +316,8 @@ async function getRoadSpeedLimits (devices, routes, threshold, minimumMinutes =
316
316
  return method(devices, routes, threshold, minimumMinutes, country && country.code)
317
317
  }
318
318
 
319
+ exports.getRoadSpeedLimits = getRoadSpeedLimits
320
+
319
321
  async function invokeValhalla (route, i, chunk, country, threshold, results, retry = 3) {
320
322
  const slice = route.slice(i, i + chunk)
321
323
  try {
package/src/util/utils.js CHANGED
@@ -254,6 +254,4 @@ exports.calculateDistance = (positions) => {
254
254
 
255
255
  exports.sortPositions = (a, b) => new Date(a.fixTime).getTime() - new Date(b.fixTime).getTime()
256
256
  exports.getLogoUrl = getLogoUrl
257
- exports.convertFromUTCDate = (value, user) => {
258
- return convertFromUTC(value, user.attributes.timezone || getUserPartner(user).timezone)
259
- }
257
+ exports.convertFromUTCDate = (value, user) => convertFromUTC(value, user.attributes.timezone || getUserPartner(user).timezone)