mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis92.github.io/angular-calendar/
MIT License
2.72k stars 864 forks source link

Switching between custom views (ex : switch between week view and a 3 days view) #1584

Closed RizkMak closed 2 years ago

RizkMak commented 2 years ago

Hello @mattlewis92, first of all thank you for this great open source calendar

Describe the issue I am trying to switch between the calendar views and display specific number of days (ex : screenshot below). I tried using the code below but it doesn't seem to work, do you have an idea about how I can proceed, please ? `

Week
    <div class="btn btn-primary" (click)="setView(CalendarView.Week)" [class.active]="view === CalendarView.Week" >
        3 days
    </div>

    <div class="btn btn-primary" (click)="setView(CalendarView.Day)" [class.active]="view === CalendarView.Day">
        Day
    </div>
</div>

<div [ngSwitch]="view">

<mwl-calendar-week-view 
*ngSwitchCase="CalendarView.Week" 
[viewDate]="viewDate">
</mwl-calendar-week-view>

<mwl-calendar-week-view 
*ngSwitchCase="CalendarView.Week" 
[viewDate]="viewDate" 
[daysInWeek]="3">
</mwl-calendar-week-view>

<mwl-calendar-day-view *ngSwitchCase="CalendarView.Day" [viewDate]="viewDate">
</mwl-calendar-day-view>

`

Screen Shot 2022-06-17 at 02 50 08
matts-bot[bot] commented 2 years ago

This issue has been closed automatically as it did not follow the issue template, please open a new issue that follows the bug report or feature request template.

If you would like to submit a support issue or get a faster reply, please consider sponsoring me.

Thank you! ✌️