aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-20 21:14:53 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-20 21:14:53 -0600
commitcb9728775b0e5eca8c705c0e2c61f9171b7068d9 (patch)
tree045635a126c10b019df933992bc32c161f6635ff /modern/src/common
parent7bf059a2bb5423fe85bcd59938acd4a40671f14b (diff)
downloadetbsa-traccar-web-cb9728775b0e5eca8c705c0e2c61f9171b7068d9.tar.gz
etbsa-traccar-web-cb9728775b0e5eca8c705c0e2c61f9171b7068d9.tar.bz2
etbsa-traccar-web-cb9728775b0e5eca8c705c0e2c61f9171b7068d9.zip
Upgraded http-proxy-middleware to 2.0.1 and fixed reports
Diffstat (limited to 'modern/src/common')
-rw-r--r--modern/src/common/formatter.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js
index f8a55da..ad0ffa2 100644
--- a/modern/src/common/formatter.js
+++ b/modern/src/common/formatter.js
@@ -4,10 +4,10 @@ export const formatBoolean = (value, t) => (value ? t('sharedYes') : t('sharedNo
export const formatNumber = (value, precision = 1) => Number(value.toFixed(precision));
-export const formatDate = (value, locale) => new Intl.DateTimeFormat(locale, {
+export const formatDate = (value, locale = 'es') => value ? new Intl.DateTimeFormat(locale, {
dateStyle: 'medium',
timeStyle: 'short',
-}).format(Date.parse(value));
+}).format(new Date(value)) : '';
export const formatPosition = (value, key, t, locale = 'es') => {
if (value != null && typeof value === 'object') {