fleetmap-reports 1.0.223 → 1.0.227

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/lang/index.js CHANGED
@@ -15,5 +15,8 @@ module.exports = {
15
15
  },
16
16
  "es-CL": {
17
17
  ...esCLLocale
18
+ },
19
+ "pt": {
20
+ ...ptPTLocale
18
21
  }
19
- };
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.223",
3
+ "version": "1.0.227",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -68,7 +68,7 @@ function processDevices(from, to, devices, data) {
68
68
  keys.forEach(key => {
69
69
  const dayLocations = groupedLocations.get(key)
70
70
  const day = {
71
- date: key,
71
+ date: new Date(key).toLocaleDateString(),
72
72
  kms: dayLocations.reduce((a, b) => a + b.attributes.distance, 0) || 0
73
73
  }
74
74
  days.push(day)
@@ -227,7 +227,7 @@ async function exportKmsReportToPDF(userData, reportData) {
227
227
  function exportKmsReportToExcel(userData, reportData) {
228
228
  console.log('Export to Excel')
229
229
 
230
- const lang = userData.user.attributes.lang
230
+ const lang = userData.user.attributes.lang || (navigator && navigator.language)
231
231
  const translations = messages[lang] ? messages[lang] : messages['en-GB']
232
232
 
233
233
  const settings = {