Not all calendars have a constant 12 months in a year. This function returns the number of months for a given year. Calendar.ISO will return 12 for all years. Add Date.days_in_month/1 Date.days_in_month/1 takes a Date.t and delegates to the Date's calendar to invoke days_in_month/1 in the calendar module.