I don’t know if my logic is right, but I’m trying to implement the calendar day view from scratch. And for implementing the sharing of same space with the same time, its kinda tricky for me.
I have a list of time:
A. 1am – 2am
B. 1am – 2.30am
C. 1.30am – 3am
So basically A-C have a common time of 2am, so they need to share in the same space. So how can do the logic of that?
It’s not hard to this. You should count overlapped tasks, assign to columns ad draw it. In your example we have 3 overlapped task. It means you have to create 3 columns for boxes representing each task.
A. 1am – 2am
B. 1am – 2.30am
C. 4.30am – 3am
This example creates 2 columns because we have only 2 overlapped tasks.
Now, when you loop tasks for count overlappings you can assign each task to specified column. When new column is required – create it.
Next loop is only drawing this boxes in assigned columns. As you can see, we have to loops: one for count overlapping and assigning columns and second for drawing.