Calculate end dates, show in calendar

This commit is contained in:
Stefan Schlott 2013-08-27 18:57:14 +02:00
parent d980530cb9
commit 1341647c2a
4 changed files with 29 additions and 3 deletions

View file

@ -3,7 +3,7 @@ events:
-
#kind: event
startdate: 2013-09-06
duration: 2d
duration: 3d
title: "MRMCD2013 - Security Advice"
url: http://mrmcd.net/
location:
@ -15,7 +15,7 @@ events:
#public: true
-
startdate: 2013-12-27
duration: 3d
duration: 4d
title: "30C3"
url: https://events.ccc.de/
location:

View file

@ -9,7 +9,15 @@ if (upcomingEvents.size>0)
<ul>
<% upcomingEvents[0..9].each do |e| %>
<li>
<%= e[:startdate].strftime("%d.%m.") %>
<% if e[:startdate].instance_of?(Date) %>
<% if e[:startdate]<e[:enddate] %>
<%= e[:startdate].strftime("%d.%m.") %> - <%= e[:enddate].strftime("%d.%m.") %>:
<% else %>
<%= e[:startdate].strftime("%d.%m.") %>:
<% end %>
<% else %>
<%= e[:startdate].strftime("%d.%m., %H:%M") %>:
<% end %>
<% if e[:url] %><a href="<%= e[:url] %>"><%= e[:title] %></a><% else %><%= e[:title] %><% end %>
</li>
<% end %>