Hi, 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. Davide
Found a solution:
dc = dp.resources[x].children[y].id; var dcStart = dp.events.find(dc).data.start; var dcEnd = dp.events.find(dc).data.end; var deStart = args.start.addMinutes(30); var deEnd = args.end.addMinutes(-30); if (dcStart >= deStart && dcStart <= deEnd || deStart >= dcStart && deStart <= dcEnd) --> OVERLAP
Hope this could help someone.
Bye Davide
Thanks for posting the solution.
DayPilot includes a helper method that checks an overlap:
var overlaps = DayPilot.Util.overlaps(start1, end1, start2, end2);
It works and it is simpler than my solution!
Thank you!
Davide