aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/util
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-22 17:32:07 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-22 17:32:07 -0700
commitf9f5ea547e61b6ff527149fa5814851240d2c967 (patch)
treee2902f69760c2c2c4837752ef81f44883b231be1 /modern/src/common/util
parent98cb21230d938ac04f53a4425e5d3eae9cfdbfda (diff)
downloadtrackermap-web-f9f5ea547e61b6ff527149fa5814851240d2c967.tar.gz
trackermap-web-f9f5ea547e61b6ff527149fa5814851240d2c967.tar.bz2
trackermap-web-f9f5ea547e61b6ff527149fa5814851240d2c967.zip
Add device expiration (fix #85)
Diffstat (limited to 'modern/src/common/util')
-rw-r--r--modern/src/common/util/formatter.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/modern/src/common/util/formatter.js b/modern/src/common/util/formatter.js
index ea18713d..88398c68 100644
--- a/modern/src/common/util/formatter.js
+++ b/modern/src/common/util/formatter.js
@@ -17,7 +17,7 @@ export const formatNumber = (value, precision = 1) => Number(value.toFixed(preci
export const formatPercentage = (value) => `${value}%`;
-export const formatTime = (value, format = 'YYYY-MM-DD HH:mm:ss') => moment(value).format(format);
+export const formatTime = (value, format = 'YYYY-MM-DD HH:mm:ss') => (value ? moment(value).format(format) : '');
export const formatStatus = (value, t) => t(prefixString('deviceStatus', value));
export const formatAlarm = (value, t) => (value ? t(prefixString('alarm', value)) : '');