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


#1

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?


#2

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();
});


#3

Hi,

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