% function arrayColumn(array, columnName) { return array.map(function(value,index) { return value[columnName]; }) } var uniqueArray = function(arrArg) { return arrArg.filter(function(elem, pos,arr) { return arr.indexOf(elem) == pos; }); }; var horas = arrayColumn(by_hour, 'start_hour'); horas = uniqueArray(horas); horasArray = {}; horas.forEach(function(element) { horasArray[element] = []; }); by_hour.forEach(function(element) { horasArray[element.start_hour].push(element); }); %>
| Hora Inicio | Hora Fin | Paciente | Telefono | Doctor | Estado Cita | Opciones |
|---|---|---|---|---|---|---|
|  <%= event.inicio %> | <%= event.fin %> | <%= event.title %> |   <%= event.telefono %> |   Dr(a)<%= event.medico %> | <%= event.estado %> |