def update_birthday(self, vevent, href, etag='', calendar=None):
        """
        XXX write docstring
        """
        assert calendar is not None

        if href is None:
            raise ValueError('href may not be None')
        ical = icalendar.Event.from_ical(vevent)
        vcard = ical.walk()[0]
        if 'BDAY' in vcard.keys():
            bday = vcard['BDAY']
            if isinstance(bday, list):
                logger.warn('Vcard {0} in collection {1} has more than one '
                            'BIRTHDAY, will be skippend and not be available '
                            'in khal.'.format(href, calendar))
                return
            try:
                if bday[0:2] == '--' and bday[3] != '-':
                    bday = '1900' + bday[2:]
                    orig_bday = False
                else:
                    orig_bday = True
                bday = parser.parse(bday).date()
            except ValueError:
                logger.warn('cannot parse BIRTHDAY in {0} in collection '
                            '{1}'.format(href, calendar))
                return
            if 'FN' in vcard:
                name = vcard['FN']
            else:
                n = vcard['N'].split(';')
                name = ' '.join([n[1], n[2], n[0]])
            event = icalendar.Event()
            event.add('dtstart', bday)
            event.add('dtend', bday + timedelta(days=1))
            event.add('summary', '{0}\'s birthday'.format(name))
            event.add('rrule', {'freq': 'YEARLY'})
            if orig_bday:
                event.add('x-birthday',
                          '{:04}{:02}{:02}'.format(bday.year, bday.month, bday.day))
                event.add('x-fname', name)
            event.add('uid', href)
            event_str = event.to_ical().decode('utf-8')
            self._update_impl(event, href, calendar)
            sql_s = ('INSERT INTO events (item, etag, href, calendar) VALUES (?, ?, ?, ?);')
            stuple = (event_str, etag, href, calendar)
            self.sql_ex(sql_s, stuple)
dataset/ETHPy150Open pimutils/khal/khal/khalendar/backend.py/SQLiteDb.update_birthday/original