From e5d17b5c331ea69393fe5facce208108e1052b81 Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Thu, 6 Oct 2016 00:39:12 +0200 Subject: [PATCH] proper upcoming events --- content/index.erb | 4 ++-- lib/helpers/events.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/index.erb b/content/index.erb index e19eb57..259b9f1 100644 --- a/content/index.erb +++ b/content/index.erb @@ -7,11 +7,11 @@
- <%= render '/partials/_tile.*', article: all_events[0], htmlclass: "highlighted", small_text: "Upcoming event" %> + <%= render '/partials/_tile.*', article: upcoming_events[0], htmlclass: "highlighted", small_text: "Upcoming event" %>
- <%= render '/partials/_tile.*', article: all_events[1], small_text: "Upcoming event" %> + <%= render '/partials/_tile.*', article: upcoming_events[1], small_text: "Upcoming event" %>
diff --git a/lib/helpers/events.rb b/lib/helpers/events.rb index a627daa..65daef9 100644 --- a/lib/helpers/events.rb +++ b/lib/helpers/events.rb @@ -5,11 +5,11 @@ module EventsHelper end def upcoming_events - all_events.reject { |x| x[:time] < Date.today } + all_events.reject { |x| x[:time] <= Date.today } end def past_events - all_events.reject { |x| x[:time] >= Date.today } + all_events.reject { |x| x[:time] > Date.today } end def grouped_events