From 2afada157decdcc64e75c82c6f943e56c7d78104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Thu, 20 Apr 2023 10:32:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=B8=B2=E6=9F=93=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 42aaba3..816b890 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -13,10 +13,16 @@ export function clearToken() { } export function dateFormat(dateStr: string) { + if (!dateStr) { + return "-"; + } return moment(dateStr).format("YYYY-MM-DD HH:mm"); } export function timeFormat(dateStr: number) { + if (!dateStr) { + return "-"; + } var d = moment.duration(dateStr, "seconds"); let value = Math.floor(d.asDays()) + @@ -117,4 +123,4 @@ export function ValidataCredentials(value: any) { return true; } } -} \ No newline at end of file +}