Use class method to check leap years

This commit is contained in:
Dirk Grambow 2009-11-17 20:46:36 +01:00
parent 04370c1fed
commit 30d0224685

View file

@ -397,7 +397,7 @@ class Date
days = MONTH_LENGTHS[month-1]
days = 29 if month == 2 and Date.civil(year,1,1).leap?
days = 29 if month == 2 and Date.leap?(year)
return days - ((Date.civil(year, month, days).wday - wday + 7) % 7)
end