Commit 0284f8448b112554e839cc856db90b6a47875e06
1 parent
6c850986
fix: 修复设备连接时间为空时的格式化bug
(cherry picked from commit bdfac4b8)
Showing
1 changed file
with
1 additions
and
1 deletions
... | ... | @@ -10,7 +10,7 @@ export function formatToDateTime( |
10 | 10 | date: moment.MomentInput = undefined, |
11 | 11 | format = DATE_TIME_FORMAT |
12 | 12 | ): string { |
13 | - return moment(date).format(format); | |
13 | + return date ? moment(date).format(format) : ''; | |
14 | 14 | } |
15 | 15 | |
16 | 16 | export function formatToDate(date: moment.MomentInput = undefined, format = DATE_FORMAT): string { | ... | ... |