fleetmap-reports 1.0.657 → 1.0.658

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/stop-report.js +3 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.657",
3
+ "version": "1.0.658",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -2,7 +2,7 @@ const { devicesToProcess, deviceName } = require('./util/device')
2
2
  const automaticReports = require('./automaticReports')
3
3
  const traccarHelper = require('./util/traccar')
4
4
  const { getNearestPOIs, insideGeofence, loadGroupsData } = require('./util/geofence')
5
- const { getTranslations, convertToLocaleString, convertMS, convertToLocaleDateString, convertToLocaleTimeString } = require('./util/utils')
5
+ const { getTranslations, convertToLocaleString, convertMS } = require('./util/utils')
6
6
  const jsPDF = require('jspdf')
7
7
  const { headerFromUser, addTable } = require('./util/pdfDocument')
8
8
  const { getStyle } = require('./reportStyle')
@@ -98,7 +98,6 @@ async function exportStopReportToPDF (userData, reportData) {
98
98
  const stopsData = userData.byDriver ? reportData.drivers : reportData.devices
99
99
 
100
100
  const headers = [
101
- translations.report.date,
102
101
  translations.report.start,
103
102
  translations.report.end,
104
103
  translations.report.address,
@@ -131,7 +130,6 @@ async function exportStopReportToPDF (userData, reportData) {
131
130
 
132
131
  d.stops.forEach(a => {
133
132
  data.push([
134
- getStopDate(userData.user, a),
135
133
  getStopStart(userData.user, a),
136
134
  getStopEnd(userData.user, a),
137
135
  a.endPOIName || a.address,
@@ -172,7 +170,6 @@ function exportStopReportToExcel (userData, reportData) {
172
170
 
173
171
  const headers = [
174
172
  { label: translations.report.vehicle, value: 'name' },
175
- { label: translations.report.date, value: 'date' },
176
173
  { label: translations.report.start, value: 'start' },
177
174
  { label: translations.report.end, value: 'end' },
178
175
  { label: translations.report.address, value: 'address' },
@@ -188,7 +185,6 @@ function exportStopReportToExcel (userData, reportData) {
188
185
  data = data.concat(d.stops.map(a => {
189
186
  return {
190
187
  name: a.deviceName,
191
- date: getStopDate(userData.user, a),
192
188
  start: getStopStart(userData.user, a),
193
189
  end: getStopEnd(userData.user, a),
194
190
  address: a.endPOIName || a.address,
@@ -214,16 +210,12 @@ function exportStopReportToExcel (userData, reportData) {
214
210
  }
215
211
  }
216
212
 
217
- function getStopDate (user, stop) {
218
- return convertToLocaleDateString(stop.startTime, user.attributes.lang, user.attributes.timezone)
219
- }
220
-
221
213
  function getStopStart (user, stop) {
222
- return convertToLocaleTimeString(stop.startTime, user.attributes.lang, user.attributes.timezone)
214
+ return convertToLocaleString(stop.startTime, user.attributes.lang, user.attributes.timezone)
223
215
  }
224
216
 
225
217
  function getStopEnd (user, stop) {
226
- return convertToLocaleTimeString(stop.endTime, user.attributes.lang, user.attributes.timezone)
218
+ return convertToLocaleString(stop.endTime, user.attributes.lang, user.attributes.timezone)
227
219
  }
228
220
 
229
221
  exports.createStopReport = createStopReport