Created
July 22, 2015 20:21
Example of a CLNDR template with options to show/hide weekends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="clndr-controls"> | |
<div class="clndr-previous-button">‹</div> | |
<div class="month font-mono"><%= intervalStart.format( 'M/DD' ) + ' — ' + intervalEnd.format( 'M/DD' ) %></div> | |
<div class="clndr-next-button">›</div> | |
</div> | |
<div class="days-of-the-week font-mono clearfix"> | |
<% i = 0; %> | |
<% _.each( daysOfTheWeek, function ( day ) { %> | |
<% if ( extras.show_weekends || ! ( i % 7 === 0 || i % 7 === 6 ) ) { %> | |
<div class="header-day"><%= day %></div> | |
<% } %> | |
<% i++ %> | |
<% }); %> | |
</div> | |
<div class="days clearfix"> | |
<% i = 0; %> | |
<% _.each( days, function ( day ) { %> | |
<% if ( i % 7 === 0 ) { %> | |
<div class="week"> | |
<% } %> | |
<% if ( extras.show_weekends || ! ( i % 7 === 0 || i % 7 === 6 ) ) { %> | |
<div class="<%= day.classes %>" id="<%= day.id %>"> | |
<span class="day-number font-mono"><%= day.day %></span> | |
<div class="events"> | |
<% var j = 0; %> | |
<% day.events = _.sortBy( day.events, 'time' ) %> | |
<% _.each( day.events, function ( e ) { %> | |
<a href="<%= e.url %>" class="event <%= e.status %>"> | |
<span class="title"><%= e.title %></span> | |
</a> | |
<% }); %> | |
</div> | |
<% } %> | |
</div><!-- /day --> | |
<% } %> | |
<% if ( i % 7 == 6 ) { %> | |
</div><!-- /week --> | |
<% } %> | |
<% i++ %> | |
<% }); %> | |
</div><!-- /days --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment