Skip to content

Fix day_of_year#326

Closed
ordermuppet wants to merge 3 commits into
ice-cube-ruby:masterfrom
ordermuppet:rmitchell/by-year-day
Closed

Fix day_of_year#326
ordermuppet wants to merge 3 commits into
ice-cube-ruby:masterfrom
ordermuppet:rmitchell/by-year-day

Conversation

@ordermuppet
Copy link
Copy Markdown

Looks like a simple fix - i.e. day_of_year(-1) should refer to day 365 (in a non-leap year), but as written it'll result in 364 (-1 + 365, on line 34). This should fix #277.

Comment thread .travis.yml
@@ -1,3 +1,5 @@
before_install:
- gem update bundler
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stole this from #321 - that build continued to fail because of an unrelated issue, addressed in this PR.

@avit
Copy link
Copy Markdown
Collaborator

avit commented Mar 7, 2016

The first commit on this branch looks good at a glance: I can apply the bundler changes separately, and the last commit with the DST issue isn't valid.

I guess this problem has gone unnoticed until this year because 2016 is a leap year, and a specific test for "Dec 31" as "-1" was untested for regular years before... can we add a test to verify both leap years and non-leap years? The scenario "every fourth year on new year's eve" from #277 seems like a worthwhile scenario to specify here.

avit added a commit that referenced this pull request Mar 19, 2017
@avit
Copy link
Copy Markdown
Collaborator

avit commented Mar 19, 2017

Merged in #381. Thanks!

@avit avit closed this Mar 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ice_cube not selecting the last day of the year correctly?

2 participants