 - - Algorithm in JavaScript to find non-collision locations for event blocks in a day grid
- PHP for time labels, CSS for style
- Source Code
- Input: events in JSON format, for example:
events=[{id : 1, start : 30, end : 150}, //- An event that starts at 9:30am and ends at 11:30am
{id : 2, start : 540, end : 600}, //- An event that starts at 6:00pm and ends at 7:00pm
{id : 3, start : 560, end : 620}, //- An event that starts at 6:20pm and ends at 7:20pm
{id : 4, start : 610, end : 670} //- An event that starts at 7:10pm pm and ends at 8:10pm
]; |
|