From ce4e029553cbbaa827b34b03487947b8f6ae1f91 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Tue, 17 May 2022 16:43:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BF=AE=E6=94=B9=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit-update-category/edit-update-category.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts b/src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts index d5091ac..fe390b5 100644 --- a/src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts +++ b/src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts @@ -35,10 +35,17 @@ export class EditUpdateCategoryComponent implements OnInit { this.data2 = JSON.parse(JSON.stringify(this.data)) if (this.data2.isLongTerm) { this.isLongTermTime = new Date(this.data2.validityStartTime) + if (this.isLongTermTime.getFullYear && this.isLongTermTime.getFullYear() < 1000) { + this.isLongTermTime = new Date() + } } else { this.isNoLongTermTime = [] this.isNoLongTermTime.push(new Date(this.data2.validityStartTime)) this.isNoLongTermTime.push(new Date(this.data2.validityEndTime)) + if (this.isNoLongTermTime.length && this.isNoLongTermTime.find(item=>{ return item.getFullYear() < 1000 })) { + this.isNoLongTermTime[0] = new Date() + this.isNoLongTermTime[1] = new Date() + } } console.log(this.data2)