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