fleetmap-reports 1.0.797 → 1.0.799

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.797",
3
+ "version": "1.0.799",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -160,7 +160,7 @@ function processDevices (from, to, devices, data, userData) {
160
160
  if (userData.groupByDay) {
161
161
  const trips = deviceTrips.filter(t => userData.allWeek || !userData.weekDays || isInsideTimetable(t, userData) || isPartialInsideTimetable(t, userData, deviceRoute))
162
162
 
163
- const dates = getDates(from, to)
163
+ const dates = getDates(from, to, userData.user.attributes.timezone)
164
164
  for (const date of dates) {
165
165
  const fromByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0)
166
166
  const toByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59)
@@ -447,7 +447,7 @@ function exportActivityReportToPDFVehicleGroupByDay (doc, translations, reportDa
447
447
  const data = []
448
448
  d.summary.forEach(s => {
449
449
  const temp = [
450
- new Date(s.date).toLocaleDateString() + ' - ' + weekDays[s.date.getDay()],
450
+ new Date(s.date).toLocaleDateString() + ' - ' + weekDays[new Date(s.date).getDay()],
451
451
  s.startTime ? new Date(s.startTime).toLocaleTimeString() : '',
452
452
  s.endTime ? new Date(s.endTime).toLocaleTimeString() : '',
453
453
  Number((s.distance / 1000).toFixed(1)),
@@ -512,7 +512,7 @@ function exportActivityReportToExcelVehicleGroupByDay (settings, translations, r
512
512
  name: d.device.name,
513
513
  group: group ? group.name : '',
514
514
  date: new Date(s.date).toLocaleDateString(),
515
- weekday: weekDays[s.date.getDay()],
515
+ weekday: weekDays[new Date(s.date).getDay()],
516
516
  start: s.startTime ? new Date(s.startTime).toLocaleTimeString() : '',
517
517
  end: s.endTime ? new Date(s.endTime).toLocaleTimeString() : '',
518
518
  distance: Number((s.distance / 1000).toFixed(0)),
@@ -583,7 +583,7 @@ function exportActivityReportToPDFDriverGroupByDay (doc, translations, reportDat
583
583
  const data = []
584
584
  d.summary.forEach(s => {
585
585
  const temp = [
586
- new Date(s.date).toLocaleDateString() + ' - ' + weekDays[s.date.getDay()],
586
+ new Date(s.date).toLocaleDateString() + ' - ' + weekDays[new Date(s.date).getDay()],
587
587
  s.startTime ? new Date(s.startTime).toLocaleTimeString() : '',
588
588
  s.endTime ? new Date(s.endTime).toLocaleTimeString() : '',
589
589
  Number((s.distance / 1000).toFixed(1)),
@@ -640,7 +640,7 @@ function exportActivityReportToExcelDriverGroupByDay (settings, translations, re
640
640
  name: d.driver.name,
641
641
  group: group ? group.name : '',
642
642
  date: new Date(s.date).toLocaleDateString(),
643
- weekday: weekDays[s.date.getDay()],
643
+ weekday: weekDays[new Date(s.date).getDay()],
644
644
  start: s.startTime ? new Date(s.startTime).toLocaleTimeString() : '',
645
645
  end: s.endTime ? new Date(s.endTime).toLocaleTimeString() : '',
646
646
  distance: Number((s.distance / 1000).toFixed(0)),