Hide calendar entries not until end date

This commit is contained in:
Stefan Schlott 2014-06-19 23:45:26 +02:00
parent 3e9157a5a5
commit d89fa29b79
2 changed files with 2 additions and 2 deletions

View file

@ -34,7 +34,7 @@ feed:
<div class="span4"> <div class="span4">
<h1>Kalender</h1> <h1>Kalender</h1>
<p> <p>
<% allUpcomingEvents = get_public_events().select { |e| e[:startdate].to_datetime > DateTime.now } <% allUpcomingEvents = get_public_events().select { |e| (e[:enddate]||e[:startdate]).to_datetime > DateTime.now }
if (allUpcomingEvents.size>0) if (allUpcomingEvents.size>0)
allUpcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime } allUpcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
%> %>

View file

@ -1,7 +1,7 @@
----- -----
style: none style: none
----- -----
<% upcomingEvents = get_public_events().select { |e| e[:startdate].to_datetime > DateTime.now } <% upcomingEvents = get_public_events().select { |e| (e[:enddate]||e[:startdate]).to_datetime > DateTime.now }
if (upcomingEvents.size>0) if (upcomingEvents.size>0)
upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime } upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
%> %>