Calculate number of days in each month