module Jiff::MonthMapper

Simple mapper between month and number of days

Constants

DAYS_MONTH

Public Class Methods

days_in_month(date) click to toggle source
# File lib/jiff/month_mapper.rb, line 6
def self.days_in_month(date)
  month = date.month
  return 29 if month == 2 && Date.gregorian_leap?(date.year)

  DAYS_MONTH[month - 1]
end