Bugfix sorting
This commit is contained in:
parent
9979b932fa
commit
bc532e14b9
1 changed files with 1 additions and 1 deletions
|
|
@ -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]}/')"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue