Skip to content

Fix to Issue #2 Top Month Always Empty#34

Open
im-mattbrown wants to merge 3 commits intosf-wdi-30:masterfrom
im-mattbrown:top_month_fix
Open

Fix to Issue #2 Top Month Always Empty#34
im-mattbrown wants to merge 3 commits intosf-wdi-30:masterfrom
im-mattbrown:top_month_fix

Conversation

@im-mattbrown
Copy link
Copy Markdown

This change to /lib/archives_sidebar/lib/archives_sidebar.rb fixes issue #2. By adding -1 here:
month = (entry.month.to_i**-1**%12)+1
this sets the correct month from an array as January would be at index zero and previously it was selecting from index 1 as 0%12= 0(january) but 1%12=1(february). In this particular case the most recent month should be September[index 8] but the logic made it select October[index 9]

@nathanallen
Copy link
Copy Markdown

nathanallen commented Sep 2, 2016

You are reasoning about this correctly, and your description is sound. Please just add +1-1+2-2+0000 to your solution and we will merge it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants