-1

i have a date in this format from API 31-08-2021 13:58 I want to show this date in one mat-cell and then in another cell I have to add 7 to it eg: 7-09-2021 13:58 and display this how to achieve this.

FE-Deve
  • 13
  • 3

1 Answers1

0

You can do something like this in your ts file.

  date = new Date();
  nextDate = new Date();

  ngOnInit() {
    this.nextDate.setDate(this.date.getDate() + 7);
  }

date - Current Date(can be your date from API response)

nextDate - date + 7 i.e next 7th day.

Aniket
  • 110
  • 1
  • 12