<% function formatAMPM(date) { var hours = date.getHours(); var minutes = date.getMinutes(); var ampm = hours >= 12 ? 'pm' : 'am'; hours = hours % 12; hours = hours ? hours : 12; // the hour '0' should be '12' minutes = minutes < 10 ? '0'+minutes : minutes; var strTime = hours + ':' + minutes + ' ' + ampm; return strTime; } %> <% if (!cls.match(/cal-day-outmonth/)) { %> <%= ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][(new Date(data_day)).getDay()] %> <%= day < 10 ? '0' : '' %><%= day %> <% if (events.length > 0) { %>
<% _.each(events, function(event) { %>
<% if (event.online_only == 'true') { %> Online Event <% } else { %> <%= event.suburb %> <% } %>
<%= event.host_name %>, <%= formatAMPM(new Date(event.start_time_to_s.replace(/-/g,'/'))) %>
<% }); %>
<% } %> <% } %>