Skip to content

Commit

Permalink
Fixes sf-wdi-25#2 by removing % and also getting rid of the +1s and -…
Browse files Browse the repository at this point in the history
…1s associated with the month
  • Loading branch information
kranjbar authored and kranjbar committed Feb 5, 2016
1 parent a399380 commit dc111ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/archives_sidebar/lib/archives_sidebar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit dc111ae

Please sign in to comment.