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#34im-mattbrown wants to merge 3 commits intosf-wdi-30:masterfrom im-mattbrown:top_month_fix
im-mattbrown wants to merge 3 commits intosf-wdi-30:masterfrom
im-mattbrown:top_month_fix
Conversation
|
You are reasoning about this correctly, and your description is sound. Please just add |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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]