Skip to content
Browse files

Fix :year option parsing for by_month

  • Loading branch information...
1 parent 1626085 commit f0bc93ae9939bdba2c75bf3bf2854b3a3c282317 @radar committed Feb 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/by_star/by_month.rb
View
3 lib/by_star/by_month.rb
@@ -14,7 +14,8 @@ def by_month_Time(time, options={})
def by_month_String_or_Fixnum(month, options={})
if valid_month?(month)
- by_month_Time("#{Time.zone.now.year}-#{month}-01".to_time, options)
+ year = options[:year] || Time.zone.now.year
+ by_month_Time("#{year}-#{month}-01".to_time, options)
else
raise ParseError, "Month must be a number between 1 and 12 or the full month name (e.g. 'January', 'Feburary', etc.)"
end

0 comments on commit f0bc93a

Please sign in to comment.
Something went wrong with that request. Please try again.