-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Added a default time frame #176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for now
@@ -31,6 +31,7 @@ export class AllMetereadsComponent implements OnInit { | |||
dataSource: MatTableDataSource<any>; | |||
readdata: any; | |||
|
|||
startDate: Date = new Date(new Date().setMonth(new Date().getMonth() - 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not add a new class property for this. We only need this value when initializing
@@ -284,7 +285,7 @@ export class AllMetereadsComponent implements OnInit { | |||
this.externalId = result.externalId; | |||
} | |||
|
|||
this.FilterForm.controls['start'].setValue(result.commissioningDate); | |||
this.FilterForm.controls['start'].setValue(this.startDate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest instead to set it to
this.FilterForm.controls['start'].setValue(result.commissioningDate || startDate);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should set this date to the startDate that you have calculated as a fallback. The default behavior should be to use the commissioningDate
Objective:
Description:
Acceptance Criteria: