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 +}