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

Event overlap javascript

Asked by Davide
16 days 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
16 days 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]
16 days 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
16 days ago.

It works and it is simpler than my solution!

Thank you!


New Reply
This reply is
Your name (optional):