def get_days_span(self, month_index):
is_first_month = month_index == <NUM_LIT:0><EOL>is_last_month = month_index == self.__len__() - <NUM_LIT:1><EOL>y = int(self.start_date.year + (self.start_date.month + month_index) / <NUM_LIT>)<EOL>m = int((self.start_date.month + month_index) % <NUM_LIT:12> or <NUM_LIT:12>)<EOL>total = calendar.monthrange(y, m)[<NUM_LIT:1>]<EOL>if is_first_month and is_last_month:<EOL><INDENT>return (self.end_date - self.start_date).days + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>if is_first_month:<EOL><INDENT>return total - self.start_date.day + <NUM_LIT:1><EOL><DEDENT>elif is_last_month:<EOL><INDENT>return self.end_date.day<EOL><DEDENT>else:<EOL><INDENT>return total<EOL><DEDENT><DEDENT>
Calculate how many days the month spans.