0

enter image description here HTML Template

 <mwl-calendar-week-view
          [viewDate]="viewDate"
          [refresh]="refresh"
          (click)="weekDayClick($event)">
        </mwl-calendar-week-view>

In the component file

weekDayClick($event){
 console.log("I need the clicked date of week view. How can I achieve this"); 
}

Example:- If I click on 16th May, then I need to trigger an event that gives me 16 May 2018.

Similarly, for 17th May it should be 17 May 2018.

For 18th May, it should be 18 May 2018 and so on.

Any suggestion will be welcome

Thanks for your valuable time!

VIKAS KOHLI
  • 8,164
  • 4
  • 50
  • 61

1 Answers1

0

Finally, I found how to fetch the date from a click on week view. We can use (dayHeaderClicked) event and can fetch the value

In component HTML File

<mwl-calendar-week-view
          [viewDate]="viewDate"
          [refresh]="refresh"
          (dayHeaderClicked)="dayHeaderClicked($event)">
        </mwl-calendar-week-view>

In component TS File

dayHeaderClicked(evn){
    // console.log(evn);
    this.viewDate = evn.day.date; // finally get the clicked date value
  }
VIKAS KOHLI
  • 8,164
  • 4
  • 50
  • 61