From bc532e14b9eab15e643eaeec960d08e3a2548d24 Mon Sep 17 00:00:00 2001 From: Stefan Schlott Date: Mon, 23 Dec 2013 14:23:49 +0100 Subject: [PATCH] Bugfix sorting --- lib/yearlyarchive.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yearlyarchive.rb b/lib/yearlyarchive.rb index 2e6cf861..0d8f444d 100644 --- a/lib/yearlyarchive.rb +++ b/lib/yearlyarchive.rb @@ -10,7 +10,7 @@ def generate_yearly_archive(articles, date_attribute, basepath, title, templaten yearlist = yearmap.keys.sort yearlist.each_index { |i| year = yearlist[i] - yearmap[year].sort! { |a,b| b[date_attribute] <=> a[date_attribute] } + yearmap[year].sort! { |a,b| b[date_attribute].to_datetime <=> a[date_attribute].to_datetime } pastfuture = yearmap[year].partition { |a| a[date_attribute].to_datetime > today.to_datetime } linkprev = if (i>0) ", :linkprev => OpenStruct.new(:title => '#{yearlist[i-1]}', :link => '#{basepath}/#{yearlist[i-1]}/')"