From dc111ae8a4ca39bf4a67566bfc5085a596f48cdc Mon Sep 17 00:00:00 2001 From: kranjbar Date: Fri, 5 Feb 2016 14:06:04 -0800 Subject: [PATCH] Fixes #2 by removing % and also getting rid of the +1s and -1s associated with the month --- lib/archives_sidebar/lib/archives_sidebar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/archives_sidebar/lib/archives_sidebar.rb b/lib/archives_sidebar/lib/archives_sidebar.rb index 9a5e879cb..74655138c 100644 --- a/lib/archives_sidebar/lib/archives_sidebar.rb +++ b/lib/archives_sidebar/lib/archives_sidebar.rb @@ -30,7 +30,7 @@ def parse_request(_contents, _params) article_counts = Content.find_by_sql(["select count(*) as count, #{date_func} from contents where type='Article' and published = ? and published_at < ? group by year,month order by year desc,month desc limit ? ", true, Time.now, count.to_i]) @archives = article_counts.map do |entry| - month = (entry.month.to_i%13) + month = entry.month.to_i year = entry.year.to_i { name: I18n.l(Date.new(year, month), format: '%B %Y'),