fleetmap-reports 2.0.57 → 2.0.59
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 +1 -1
- package/src/util/traccar.js +5 -1
package/package.json
CHANGED
package/src/util/traccar.js
CHANGED
|
@@ -132,19 +132,23 @@ async function getAllInOne (
|
|
|
132
132
|
async function getSummaryByDay (dates, userData, traccarInstance, allDevices, ignorePercentage = false, from, to) {
|
|
133
133
|
const days = []
|
|
134
134
|
let counter = 0
|
|
135
|
+
console.log('dates', dates.length)
|
|
135
136
|
for (const [index, date] of dates.entries()) {
|
|
136
137
|
let startDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + userData.dayHours.startTime)
|
|
137
138
|
if (index === 0) {
|
|
138
139
|
const _startDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + (isClientSide() ? from.toTimeString().slice(0, 8) : convertFromUTC(from, userData.user.attributes.timezone).toTimeString().slice(0, 8)))
|
|
140
|
+
console.log(_startDateLocal)
|
|
139
141
|
startDateLocal = startDateLocal.getTime() > _startDateLocal.getTime() ? startDateLocal : _startDateLocal
|
|
140
142
|
}
|
|
141
143
|
|
|
144
|
+
console.log(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + userData.dayHours.endTime)
|
|
142
145
|
let endDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + userData.dayHours.endTime)
|
|
143
146
|
if (index === dates.length - 1) {
|
|
144
147
|
const _endDateLocal = new Date(convertFromUTC(date, userData.user.attributes.timezone).toISOString().split('T')[0] + ' ' + (isClientSide() ? to.toTimeString().slice(0, 8) : convertFromUTC(to, userData.user.attributes.timezone).toTimeString().slice(0, 8)))
|
|
148
|
+
console.log(_endDateLocal)
|
|
145
149
|
endDateLocal = endDateLocal.getTime() < _endDateLocal.getTime() ? endDateLocal : _endDateLocal
|
|
146
150
|
}
|
|
147
|
-
|
|
151
|
+
console.log(date, startDateLocal, endDateLocal)
|
|
148
152
|
const startDate = isClientSide() ? startDateLocal : convertFromLocal(startDateLocal, userData.user.attributes.timezone)
|
|
149
153
|
const endDate = isClientSide() ? endDateLocal : convertFromLocal(endDateLocal, userData.user.attributes.timezone)
|
|
150
154
|
|