Adds a holiday event to the calendar. start_dt and end_dt (if supplied) should be date objects. Returns True if the event was added.

def add_holiday(self, start_dt, holiday_name, end_dt = None, calendar_id = 'notices'):
        '''Adds a holiday event to the calendar. start_dt and end_dt (if supplied) should be date objects. Returns True if the event was added.'''

        assert(calendar_id in self.configured_calendar_ids.keys())
        calendarId = self.configured_calendar_ids[calendar_id]

        # Note: end_date is one day ahead e.g. for the New Years' holiday Dec 31-Jan 1st, we specify the end_date as Jan 2nd. This is what the calendar expects.
        if not end_dt:
            end_dt = start_dt
        start_date = date(year=start_dt.year, month=start_dt.month, day=start_dt.day)#, tzinfo=self.timezone)
        end_date = date(year=end_dt.year, month=end_dt.month, day=end_dt.day) + timedelta(days = 1) #, tzinfo=self.timezone)
        start_time = datetime(year=start_dt.year, month=start_dt.month, day=start_dt.day, hour=0, minute=0, second=0, tzinfo=self.timezone) + timedelta(days = -1)
        end_time = datetime(year=end_dt.year, month=end_dt.month, day=end_dt.day, hour=23, minute=59, second=59, tzinfo=self.timezone) + timedelta(days = 2)

        # Do not add the quarter multiple times
        events = self.get_events((start_time + timedelta(days = -1)).isoformat(), (end_time + timedelta(days = 1)).isoformat(), ignore_cancelled = True)
        for event in events:
            if event.summary.find(holiday_name) != -1:
                return False

        event_body = {
            'summary' : holiday_name,
            'description' : holiday_name,
            'start' : {'date' : start_date.isoformat(), 'timeZone' : self.timezone_string},
            'end' : {'date' : end_date.isoformat(), 'timeZone' : self.timezone_string},
            'status' : 'confirmed',
            'extendedProperties' : {
                'shared' : {
                    'event_type' : 'Holiday'
                }
            }
        }
        if abs((end_date - start_date).days) > 7:
            raise Exception('The range of dates from {0} to {1} is greater than expected. Please check to make sure that the dates are correct.'.format(start_date, end_date))
        elif end_date < start_date:
            raise Exception('Error: The end date {1} occurs before the start date ({0}).'.format(start_date, end_date))

        created_event = self.service.events().insert(calendarId = self.configured_calendar_ids[calendar_id], body = event_body).execute()
        return True