Appointment/agenda with emberJs


Hello there !

I made an Ember app which have a scheduling feature. Basically, I want to save appointments in a week-looking agenda.

Basic specs

1- The schedule is divided by 15 minutes ranges
2- The appointment have a timestamp and a length (1, 2, 3, … x 15 minutes)
3- I don’t need more flexibility than this.

Right now, to display a week, I do the following :

1 - CONTROLLER ~ I filter/query the appointments for the given week (here, everything’s alright)
2 - CONTROLLER ~ I order them by (hour, and day). The trick here, is to follow the order of an HTML table (tr, then td)
3 - VIEW ~ I render manually the view with the buffer, and since the appointments order is correct, I can use it like a stack (only check the top appointment time, not the full stack)

I made the ordering trick to avoid the double loop (loop on time, and then loop in all appointment to find if there’s a match).

But, I have a few issues :
1 - Even with the trick, it still feel a bit slow, but not a big deal.
2 - It’s easy to break, if I have 2 appointments at a same time (which is not supposed to happen but still), the top of the stack if “corrupted” and all the following events are ignored.
3 - I’m not really confortable with this implementation, all these filter and order feels a bit to hacky and don’t sounds like a real solution to me.

I just plan to work on this logic to fix these things, but before going deeper, I want to hear from Ember folks if there’s something I didn’t saw and could help me to do things right.

Also, I would like to avoid using a plugin for this, since it’s a core feature in my project and these plugins have from little to no support at all, I don’t want to bind me to this.

Voilà !

I hope this discussion will bring answers to some.