# File lib/active_support/core_ext/time/calculations.rb, line 16 def days_in_month(month, year=nil) if month == 2 !year.nil? && (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)) ? 29 : 28 elsif month <= 7 month % 2 == 0 ? 30 : 31 else month % 2 == 0 ? 31 : 30 end end