search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Event overlap javascript

Asked by Davide
1 year ago.

is there a javascript method to check if two child events with different parent are overlapping?

Via code (js) i'm able to retreive this two events during resizing event of one of them but it's quite difficult to check if the are overlapping using each start and time.

Thank you.

Answer posted by Davide
1 year ago.

Found a solution:

dc = dp.resources[x].children[y].id;

var dcStart =;
var dcEnd =;
var deStart = args.start.addMinutes(30); 
var deEnd = args.end.addMinutes(-30); 
if (dcStart >= deStart && dcStart <= deEnd || deStart >= dcStart && deStart <= dcEnd)

Hope this could help someone.


Comment posted by Dan Letecky [DayPilot]
1 year ago.

Thanks for posting the solution.

DayPilot includes a helper method that checks an overlap:

var overlaps = DayPilot.Util.overlaps(start1, end1, start2, end2);
Comment posted by Davide
1 year ago.

It works and it is simpler than my solution!

Thank you!


This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.