From f9f5ea547e61b6ff527149fa5814851240d2c967 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 22 Jul 2022 17:32:07 -0700 Subject: Add device expiration (fix #85) --- modern/src/common/util/formatter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modern/src/common/util/formatter.js') 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)) : ''); -- cgit v1.2.3