I'm in the process of developing a timetable app that features buttons for the previous day, current day, and next day. How can I implement a button to specifically show the current day?
HTML File
<button type="button" (click)="previousDay()" >Left</button>
<br>
<h2>{{ currentDay }}</h2>
<br>
<button type="button" (click)="nextDay()" >Right</button>
<br>
<button type="button" (click)="currentDay()" >Current Day</button>
<br>
</div>
TypeScript File:
export class DayViewComponent implements OnInit {
events: any[];
currentDay: Date;
modalActive: boolean = false;
previousDay() {
this.currentDay.setDate(this.currentDay.getDate()-1);
}
nextDay() {
this.currentDay.setDate(this.currentDay.getDate()+1);
}
currentDay(){
}
}