diff --git a/lib/holidays.rb b/lib/holidays.rb index 4efde5e..4e6e5e0 100644 --- a/lib/holidays.rb +++ b/lib/holidays.rb @@ -393,7 +393,7 @@ class Date # :first, :second, :third, :fourth or :fifth if week > 0 - return ((week - 1) * 7) + 1 + ((7 + wday - Date.civil(year, month,(week-1)*7 + 1).wday) % 7) + return ((week - 1) * 7) + 1 + ((wday - Date.civil(year, month,(week-1)*7 + 1).wday) % 7) end days = MONTH_LENGTHS[month-1] diff --git a/test/test_date.rb b/test/test_date.rb index ef6b372..bb04bc6 100644 --- a/test/test_date.rb +++ b/test/test_date.rb @@ -6,7 +6,7 @@ class DateTests < Test::Unit::TestCase end def test_extending_date_class - assert @date.respond_to?('holiday?') + assert @date.respond_to?('holidays') assert @date.respond_to?('holiday?') end