Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to Issue #2 Top Month Always Empty #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix to Issue #2 Top Month Always Empty #34

wants to merge 3 commits into from

Conversation

im-mattbrown
Copy link

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

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.

None yet

2 participants