open popup by click on selected date in mat-calender

Viewed 147

Here my code in .html

<mat-card>
  <mat-calendar #calendar [dateClass]="dateClass()"  (click)="onSelect()"></mat-calendar>
   
</mat-card>

below you can see my dataClass() method in .ts file

dateClass() {
    return (date: Date): MatCalendarCellCssClasses => {
      const highlightDate = this.datesToHighlight
        .map(strDate => new Date(strDate))
        .some(d => d.getDate() === date.getDate() && d.getMonth() === date.getMonth() && d.getFullYear() === date.getFullYear());
        
      return highlightDate ? 'special-date' : '';
    };
  }

I passed the date from the database and show it in the calendar. But how can I pop up a dialog from only selected days?

0 Answers
Related