Ignore events from the past

This commit is contained in:
Blerim Sheqa 2019-07-22 13:26:11 +02:00
parent 2a14f4610a
commit a300248533
1 changed files with 8 additions and 1 deletions

View File

@ -68,7 +68,14 @@ def get_events(git, source_dir, categories)
category_events = YAML::load_file(clone_target + '/' + category + '.yml')
if category_events
category_events_sorted = category_events.sort_by { |k| k['date'] }
events << category_events_sorted[0]
category_events_sorted.each do |event|
if event['date'] > Date.today
events << event
break
else
next
end
end
end
end