添加了解析时间的容错

This commit is contained in:
luyuan 2020-11-20 16:07:47 +08:00
parent 5ff242d71b
commit b5edb78131
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3

View File

@ -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){