I know that this question has been asked before, but several new versions have been released since then.
Is it possible to handle a dblclick event for creating a new appointment in the calendar without having to modify the fullcalendar.js file? It would be great to handle this extension in a separate file together with my other tweaks.
Thanks in advance!
/Adam
Detect when the user clicks on dates or times. Give the user the ability to select multiple dates or time slots with their mouse or touch device. Allows a user to highlight multiple days or timeslots by clicking and dragging.
You can try the following thread's solution(dayClick or select function to disable the dayclick for the past dates in fullcalendar). You can visit the fullcalendar support center and post your fullcalendar question on the StackOverflow fullcalendar tag.
You can change the color of all events on the calendar like so: var calendar = new Calendar(calendarEl, { events: [ // my event data ], eventColor: '#378006' }); You can use any of the CSS color formats such #f00 , #ff0000 , rgb(255,0,0) , or red .
Just to add to Juan Gonzales's answer:
$("#calendar").fullCalendar({
dayRender: function(date, element, view){
element.bind('dblclick', function() {
alert('double click!');
});
}
});
This code will create the dblclick
event to the whole "day" event.
Source
I ran across the same issue and didn't want to fiddle with the core, so I wrote double-click logic into the dayClick callback.
dayClick:function( date, allDay, jsEvent, view ) {
var singleClick = date.toUTCString();
if(doubleClick==singleClick){
console.log('Double-click!');
doubleClick = null;
}else{
doubleClick=date.toUTCString();
clearInterval(clickTimer);
clickTimer = setInterval(function(){
doubleClick = null;
clearInterval(clickTimer);
}, 500);
}
}
clickTimer
and doubleClick
are declared before the call to initialize the calendar.
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