Commit bdfac4b8ee7dbac1f2381eedba6b66ef6a38d851

Authored by xp.Huang
1 parent 6804cf0e

fix: 修复设备连接时间为空时的格式化bug

Showing 1 changed file with 1 additions and 1 deletions
@@ -10,7 +10,7 @@ export function formatToDateTime( @@ -10,7 +10,7 @@ export function formatToDateTime(
10 date: moment.MomentInput = undefined, 10 date: moment.MomentInput = undefined,
11 format = DATE_TIME_FORMAT 11 format = DATE_TIME_FORMAT
12 ): string { 12 ): string {
13 - return moment(date).format(format); 13 + return date ? moment(date).format(format) : '';
14 } 14 }
15 15
16 export function formatToDate(date: moment.MomentInput = undefined, format = DATE_FORMAT): string { 16 export function formatToDate(date: moment.MomentInput = undefined, format = DATE_FORMAT): string {