Created
January 26, 2015 14:31
-
-
Save excid3/b197f1dc913def10f749 to your computer and use it in GitHub Desktop.
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
<%= week_calendar events: @meetings do |date, meetings| %> | |
<%# Print out the date at the top %> | |
<%= date %> | |
<% (0..23).each do |hour| %> | |
<div class="hour-of-day"> | |
<%# Print out the current hour %> | |
<%= Time.parse("#{hour}:00").strftime("%l %P") %> | |
<%# Filter out the meetings that are scheduled for the same hour. %> | |
<%# You may also want to sort the resulting array to make sure they display in order %> | |
<% meetings.select{ |m| m.scheduled_time.hour == hour }.each do |meeting| %> | |
<div><%= meeting.name %></div> | |
<% end %> | |
</div> | |
<% end %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment