From 6e86749e94f721d2cd649346608a5ea8d3fe8fd9 Mon Sep 17 00:00:00 2001 From: zhuyue Date: Fri, 20 Aug 2021 15:43:00 +0800 Subject: [PATCH] fix: Fix getSinceTime when param is null/undefined fix getSinceTime when param is null/undefined Change-Id: I90288dc87afea6402f4663ba0b8100458615fa89 --- src/utils/time.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/time.js b/src/utils/time.js index 09b8b6dd..1a41a1ed 100644 --- a/src/utils/time.js +++ b/src/utils/time.js @@ -54,6 +54,9 @@ export const checkTimeIn = (inputTime, start, end) => { }; export const getSinceTime = (input) => { + if (!input) { + return '-'; + } return getLocalTime(input).fromNow(); };