ngOnInit(): void {
this.currentDate = new Date();
this.date = this.datePipe.transform(this.currentDate, 'y-MM-dd');
this.currentDate = this.date;
}
In the above code Im getting current date. The requirement is from this current date need to subtract a day means i can get yesterday.