Use class method to check leap years

master
Dirk Grambow 2009-11-17 20:46:36 +01:00
parent 04370c1fed
commit 30d0224685
1 changed files with 1 additions and 1 deletions

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