def get_by_date(session, calendarobj, start_date, end_date, tzone='UTC'): """ Returns all the meetings in a given time period. Recursive meetings are expanded as if each was a single meeting. :arg session: the database session to use :arg calendarobj: the calendar (object) of interest. :arg start_date: a Date object representing the beginning of the period :arg start_date: a Date object representing the ending of the period :kwarg tzone: the timezone in which the meetings should be displayed defaults to UTC. """ meetings_utc = Meeting.get_by_date(session, calendarobj, start_date, end_date, no_recursive=True) meetings_utc.extend(Meeting.get_regular_meeting_by_date(session, calendarobj, start_date, end_date)) meetings = [] for meeting in list(set(meetings_utc)): meetings.append(convert_meeting_timezone( meeting, 'UTC', tzone)) meetings.sort(key=operator.attrgetter('meeting_date')) return meetings