邵佳豪 3 years ago
parent
commit
363ad15391
  1. 7
      src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts

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

Loading…
Cancel
Save