Multiple calendars on a page
I'm trying to wrap my head around it, but I can't seem to think of a way to get multiple calendars with different events on a single page to work. Any pointers?
You might want to check #40 out. You basically want to create n clndr instances. I'm actually working on something like that and the only problem we have run into is switching all (3 in our case) months. That was solved by a custom handler and calling previos/next on all of the calendars in a collection.
@jeremiecarlson each calendar instance can take a different array of events, for example:
var firstEventsArray = [{ date: '2013-11-27' }, ... ];
var secondEventsArray = [{ date: '2013-12-25' }, ... ];
$('#calendar1').clndr({
events: firstEventsArray
});
$('#calendar2').clndr({
events: secondEventsArray
});
As @DawidJanczak pointed out, you can write an event handler that is shared between all of the calendar instances if you need to link several to the same next/previous action.
Does that answer your question?
@DawidJanczak Thanks, I really should have checked closed issues - my bad.
@kylestetz Yeah, sorry I was being kinda vague in my question. I have 2 main issues:
- Getting the events from a back-end service and associating them with the correct instance of clndr, but I think I should be able to do that by getting back-end to spit it out on the page, and I'll look through available events arrays... We'll see.
- Event handling (binding prev/next only to that instance) which looks like I can work with #40
Thank you for your quick responses