fleetmap-reports 1.0.940 → 1.0.942

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.940",
3
+ "version": "1.0.942",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/util/trips.js CHANGED
@@ -36,10 +36,11 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
36
36
  const tripStart = new Date(t.startTime)
37
37
  const tripEnd = new Date(t.endTime)
38
38
 
39
+ console.log('calculatePartialTrip', tripStart, tripEnd, endDate, startDate)
39
40
  if (startDate.getTime() > endDate.getTime()) {
40
41
  if (tripStart.getTime() < endDate.getTime() &&
41
42
  tripEnd.getTime() > endDate.getTime()) {
42
- // Trip starts inside time period and ends outside time period
43
+ console.log('Trip starts inside time period and ends outside time period', route, device)
43
44
  if (!route && device) {
44
45
  const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
45
46
  route = allInOneData.route
@@ -53,7 +54,7 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
53
54
 
54
55
  if (tripStart.getTime() < startDate.getTime() &&
55
56
  new Date(t.endTime).getTime() > startDate.getTime()) {
56
- // Trip starts outside time period and ends inside time period
57
+ console.log('Trip starts outside time period and ends inside time period', route, device)
57
58
  if (!route && device) {
58
59
  const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
59
60
  route = allInOneData.route
@@ -67,7 +68,7 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
67
68
  } else {
68
69
  if (tripStart.getTime() < startDate.getTime() &&
69
70
  tripEnd.getTime() > startDate.getTime()) {
70
- // Trip starts outside time period and ends inside time period
71
+ console.log('Trip starts outside time period and ends inside time period', route, device)
71
72
  if (!route && device) {
72
73
  const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
73
74
  route = allInOneData.route
@@ -81,7 +82,7 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
81
82
 
82
83
  if (tripStart.getTime() < endDate.getTime() &&
83
84
  tripEnd.getTime() > endDate.getTime()) {
84
- // Trip starts inside time period and ends outside time period
85
+ console.log('Trip starts inside time period and ends outside time period', route, device)
85
86
  if (!route && device) {
86
87
  const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
87
88
  route = allInOneData.route