<%= cal.locale.time %>
<%= cal.locale.events %>
<% if(all_day.length) {%>
<%= cal.locale.all_day %>
<% _.each(all_day, function(event){ %> <% }); %>
<% }; %> <% if(before_time.length) {%>
<%= cal.locale.before_time %>
<% _.each(before_time, function(event){ %>
<%= event.end_hour %> <%= event.title %>
<% }); %>
<% }; %>
<% for(i = 0; i < hours; i++){ %>
<% for(l = 0; l < cal._hour_min(i); l++){ %>
<%= cal._hour(i, l) %>
<% }; %>
<% }; %>
<% 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); }); %> <% _.each(horasArray, function(e,i){ %>
<% _.each(e, function(event,indice){ %> <% }); %>
<% }); %>
<% if(after_time.length) {%>
<%= cal.locale.after_time %>
<% _.each(after_time, function(event){ %>
<%= event.start_hour %> <%= event.title %>
<% }); %>
<% }; %>