From b5edb781315366c2ccfa748306ec3ac69dfb9bc0 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Fri, 20 Nov 2020 16:07:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=9A=84=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/date.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/date.ts b/src/utils/date.ts index e58810e..fdad371 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -73,7 +73,12 @@ export function getweek(time: string, id: string,zhou?: number){ dayjs.extend(timezone) const days: any = dayjs; console.log(id, 11111) - let now = days((!time ? undefined : time)).tz(id) + let now; + try { + now = days((!time ? undefined : time)).tz(id) + } catch (error) { + now = days(undefined).tz(id) + } console.log(now, 11111) if(zhou != undefined){