Get start date and end date of an event while dragging that event

Hi @Polina

i have some events in my scheduler . so i want to get the start date and end date of the event while dragging . i have seen an event onEventDrag and implemented it but it just gives 3 parameters id, mode and e. none of these parameters are useful to get the start date and end date while dragging.
so basically i need to show the dynamic start date and end date of the event while dragging as a tool tip. how can i do that?

Okay no worries solved the problem :slight_smile:
var calendar =scheduler;
calendar.attachEvent(ā€œonEventDragā€,function(id, mode, e){
var event = calendar.getEvent(id)
var format = calendar.date.date_to_str("%d-%m-%y %H:%i");
calendar.dhtmlXTooltip.show(format(event.start_date) + " - " + format(event.end_date));
return true;
});

//if you donā€™t want tooltip on event hover do this else no need
calendar.attachEvent(ā€œonMouseMoveā€, function (id, mode, e){
calendar.dhtmlXTooltip.hide();
});

//to close tooltip after drag
calendar.attachEvent(ā€œonDragEndā€, function (id, mode, e){
calendar.dhtmlXTooltip.hide();
});

Hi,

Thank you for sharing the solution. It can help anyone else in the future.

1 Like