Skip to content

Commit

Permalink
Added value when initializing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingcedru committed Oct 8, 2024
1 parent 021dfcc commit fba75e2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class AllMetereadsComponent implements OnInit {
dataSource: MatTableDataSource<any>;
readdata: any;

startDate: Date = new Date(new Date().setMonth(new Date().getMonth() - 1));
startDate: Date;
devicedata: any;
p: number = 1;
total: number = 0;
Expand Down Expand Up @@ -66,7 +66,9 @@ export class AllMetereadsComponent implements OnInit {
private deviceservice: DeviceService,
private adminService: AdminService,
private orgService: OrganizationService,

) {
this.startDate = new Date(new Date().setMonth(new Date().getMonth() - 1));
this.loginuser = JSON.parse(sessionStorage.getItem('loginuser')!);
this.apiuserId = sessionStorage.getItem('apiuserId')!;
}
Expand Down Expand Up @@ -285,7 +287,7 @@ export class AllMetereadsComponent implements OnInit {
this.externalId = result.externalId;
}

this.FilterForm.controls['start'].setValue(this.startDate);
this.FilterForm.controls['start'].setValue(result.commissioningDate || this.startDate);
this.FilterForm.controls['end'].setValue(new Date());

this.getPagedData();
Expand Down

0 comments on commit fba75e2

Please sign in to comment.