The question is:
how to display (what to change inside code) to display different info in week view and in day view f.ex.:
week view - time, title
day view - time, title, description ect.
and pro-forma: month view - time, title
The question is:
how to display (what to change inside code) to display different info in week view and in day view f.ex.:
week view - time, title
day view - time, title, description ect.
and pro-forma: month view - time, title
In the global JS declare,
var currentView;
In the constructor of fullCalendar there is viewDisplay trigger, use this code.
viewDisplay: function(view) {
//This is very ugly way to change events on switch... but it works!
//Every time you you use 'gotoDate' this will trigger, also pressing next, previous
if (view.name != currentView) {
if ( view.name == 'basicWeek' )
{
$('#myDateSelector').hide();
$('#calendar').fullCalendar( 'removeEventSource', 'json_day.php' );
$('#calendar').fullCalendar( 'addEventSource', 'json_week.php' );
console.log("week");
}
if (view.name == 'basicDay' )
{
$('#myDateSelector').show();
$('#calendar').fullCalendar( 'removeEventSource', 'json_week.php' );
$('#calendar').fullCalendar( 'addEventSource', 'json_day.php' );
console.log("day");
}
//You can use it some where else to know what view is active quickly
currentView = view.name;
}
},
The code is very hacky, but it is much better than digging in the source code for the calendar. You must remember to add and remove any feeds, usually you will notice that your feeds start to duplicate.. this means there is a remove missing somewhere.