I use the jQuery Calendar with an underscore template and I wanted to put <li>
tags around each week. This does the trick, but it's awful.
<% _.each(days, function(day, index) { %>
<% if ( index % 7 == 0 && index != 0) { %></li><% } %>
<% if ( index % 7 == 0) { %><li><% } %>
<div class="<%= day.classes %>"><%= day.day %></div>
<% if ( _.size(days) == index + 1 ) { %></li><% } %>
<% }); %>
There must be another (elegant) way of doing this.