Fix possible problems with Date/Time comparison. Calendar in sidebar.
This commit is contained in:
parent
0ae50c117c
commit
d980530cb9
3 changed files with 20 additions and 5 deletions
|
|
@ -29,9 +29,9 @@ feed:
|
|||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<% upcomingEvents = get_events().select { |e| e[:startdate] > Time.now }
|
||||
<% upcomingEvents = get_events().select { |e| e[:startdate].to_datetime > DateTime.now }
|
||||
if (upcomingEvents.size>0)
|
||||
upcomingEvents.sort! { |a,b| a[:startdate] <=> b[:startdate] }
|
||||
upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
|
||||
%>
|
||||
<div class="span6">
|
||||
<div class="well well-large">
|
||||
|
|
@ -47,9 +47,9 @@ feed:
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% upcomingRegularsTable = get_regulars_tables().select { |e| e[:startdate] > Time.now }
|
||||
<% upcomingRegularsTable = get_regulars_tables().select { |e| e[:startdate].to_datetime > DateTime.now }
|
||||
if (upcomingRegularsTable.size>0)
|
||||
upcomingRegularsTable.sort! { |a,b| a[:startdate] <=> b[:startdate] }
|
||||
upcomingRegularsTable.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
|
||||
%>
|
||||
<div class="span6">
|
||||
<div class="well well-large">
|
||||
|
|
|
|||
|
|
@ -1,8 +1,20 @@
|
|||
-----
|
||||
style: none
|
||||
-----
|
||||
<% upcomingEvents = get_public_events().select { |e| e[:startdate].to_datetime > DateTime.now }
|
||||
if (upcomingEvents.size>0)
|
||||
upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
|
||||
%>
|
||||
<h1>Kalender</h1>
|
||||
|
||||
<ul>
|
||||
<% upcomingEvents[0..9].each do |e| %>
|
||||
<li>
|
||||
<%= e[:startdate].strftime("%d.%m.") %>
|
||||
<% if e[:url] %><a href="<%= e[:url] %>"><%= e[:title] %></a><% else %><%= e[:title] %><% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<h1>Letzte Tweets</h1>
|
||||
<p>
|
||||
<%= render 'twitter_list', :items => twitter_by_date().first(5) %>
|
||||
|
|
|
|||
|
|
@ -20,4 +20,7 @@ def get_regulars_tables()
|
|||
items.select { |i| (i[:kind]=='event') && i.identifier.start_with?('/_data/stammtisch/') }
|
||||
end
|
||||
|
||||
def get_public_events()
|
||||
items.select { |i| (i[:kind]=='event') && i[:public] }
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue