Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple calendars on one page #121

Closed
hakikihacioglu opened this issue Jun 5, 2017 · 8 comments
Closed

Multiple calendars on one page #121

hakikihacioglu opened this issue Jun 5, 2017 · 8 comments

Comments

@hakikihacioglu
Copy link

Hi,

is it possible to use more than 1 calendar on a page? If yes how can create 2 different variables

Thank you

@twinssbc
Copy link
Owner

twinssbc commented Jun 5, 2017

@hakikihacioglu Binding the calendar to two different variables is easy. But just tried to put two calendar elements in one page, it seems the swiping function doesn't work properly. Swiping the second calendar causing the first one moves. Not sure if it's some ion-slides issue.

@hakikihacioglu
Copy link
Author

How does assigning different variables to different calendars work?

@twinssbc
Copy link
Owner

twinssbc commented Jun 5, 2017

    <calendar [eventSource]="eventSource"
              [calendarMode]="calendar.mode"
              [currentDate]="calendar.currentDate"
              (onCurrentDateChanged)="onCurrentDateChanged($event)"
              (onEventSelected)="onEventSelected($event)"
              (onTitleChanged)="onViewTitleChanged($event)"
              (onTimeSelected)="onTimeSelected($event)"
              [showEventDetail]="calendar.showEventDetail"
              step="30">
    </calendar>
    <calendar [eventSource]="eventSource2"
              [calendarMode]="calendar2.mode"
              [currentDate]="calendar2.currentDate"
              (onCurrentDateChanged)="onCurrentDateChanged($event)"
              (onEventSelected)="onEventSelected($event)"
              (onTitleChanged)="onViewTitleChanged($event)"
              (onTimeSelected)="onTimeSelected($event)"
              [showEventDetail]="calendar2.showEventDetail">
    </calendar>

@ngarland79
Copy link

Including ion-slides on the same page as the calendar actually locks the slides. Can't move them. Same thing with putting two calendars on the same page. Only the first one is swipeable.

@Titoch
Copy link

Titoch commented Oct 10, 2017

Hi,
When I use 2 calendars instances (MonthView) on 2 different pages/modules, the first one has a correct behavior.
But the swipes events performed on second calendar#2 are still handled by calendar#1 (even if not displayed / Not same page).

Is there a way to force subscribe/unsubscribe swipe's events on init/destroy of the page?
Thank you very much for your help!

@twinssbc
Copy link
Owner

@Titoch This is the known issue of ion-slides.
See ionic-team/ionic-framework#12008, Ionic team hasn't come up an official fix for it.

@pcsantana
Copy link

Hi @twinssbc ! Thanks for the great plugin!
The issue ionic-team/ionic-framework#12008 seems to be fixed, but I still have the same problem that @Titoch said. I have a second calendar in another page, but it not working as expected, just the first one works fine.
Any update on this issue?

Thank you again!

@pcsantana
Copy link

@twinssbc , sorry, it was my mistake!
Actually after searching a little I found your comment, and I realized that in my second page I used hidden, and this was causing the issue. I will change my logic to use *ngIf instead.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants