Here you go--- Its not that difficult actually. Click on the Cal1 day and the Cal2 Changes!
http://jsfiddle.net/ppumkin/A56LN/
CODE
$('#mycalendar1').fullCalendar(
{
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
dayClick: function( date, allDay, jsEvent, view ) {
dayClicked(date);
},
events: [
{
title : 'event2',
start : '2011-03-10',
end : '2011-07-25'
}
]
});
$('#mycalendar2').fullCalendar(
{
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultView: 'agendaDay',
events: [
{
title : 'event2',
start : '2011-03-10',
end : '2011-07-25'
}
]
});
function dayClicked(date){
$('#mycalendar2').fullCalendar( 'gotoDate', date );
}
Clicking the "TODAY" and other buttons..
I got some code like this. but this is not the solution. because it shows the date before the calendar changes. so basically the old date- maybe you can use a time-out? 500ms? or something - because jquery binds before the fullcalendar...
$('.fc-button-today').click(function() {
alert($('#mycalendar2').fullCalendar( 'getDate' ));
//dayClicked($('#mycalendar2').fullCalendar( 'getDate' ))
});
You might have to use the viewDisplay event. But it gets a bit complicated in there. Here is a document how to use it.
http://arshaw.com/fullcalendar/docs/display/viewDisplay/
Look at DoomsDay answer- nice solution :D
An internal hack for day click and possibly other buttons.
You can open fullcalendar.js and goto line about... 3220 or search for Slot/Day clicking and binding
/* Slot/Day clicking and binding
-----------------------------------------------------------------------*/
function dayBind(cells) {
cells.click(slotClick)
.mousedown(daySelectionMousedown);
//OVER HERE INSERT YOUR CUSTOM CALL!
setMyOtherCalendar();
}
and in your page somewhere you would havbe a public function of setMyOtherCalendar and it would have this simple code in it.. init mate?
function setMyOtherCalendar(){
$('#mycalendar2').fullCalendar( 'gotoDate', $('#mycalendar1').fullCalendar( 'getDate' ) );
};