According to the fullcalendar docs selectHelper accepts a function:
A function can also be specified for drawing custom elements. It will be given 2 arguments: the selection's start date and end date (Moment objects). It must return a DOM element that will be used.
However this feature doesn't work. In fact nothing in the source code checks selectHelper for typeof function.
Any ideas?
$(document).ready(function() {
calendar = $('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
},
date: '2014-01-12',
defaultView: 'month',
selectable: true,
selectHelper: function(start, end) {
return $("<div style='background:red' />").text(start+' '+end);
},
editable: true,
events: [
{
title: 'All Day Event',
start: '2014-01-01'
},
{
title: 'Long Event',
start: '2014-01-07',
end: '2014-01-10'
},
{
id: 999,
title: 'Repeating Event',
start: '2014-01-09T16:00:00'
},
{
id: 999,
title: 'Repeating Event',
start: '2014-01-16T16:00:00'
},
{
title: 'Meeting',
start: '2014-01-12T10:30:00',
end: '2014-01-12T12:30:00'
},
{
title: 'Lunch',
start: '2014-01-12T12:00:00'
},
{
title: 'Birthday Party',
start: '2014-01-13T07:00:00'
},
{
title: 'Click for Google',
url: 'http://google.com/',
start: '2014-01-28'
}
]
});
});
That is definitely a bug
I submitted an issue on GitHub
https://github.com/arshaw/fullcalendar/issues/2832
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With