[Vobject] Problem with BDAY in vcard
Jeffrey Harris
jeffrey at osafoundation.org
Mon Nov 19 16:51:30 CST 2007
Hi Patrick,
> Seams i will discover some more holes...
> BDAY seams to be not implemented correct. If I assign a date object to
> it, it wont work. And if i convert the date to a string i am not able to
> preassign a "date:" to it so it looks like BDAY;value=date:1980-09-26.
> Is there an other way to do this?
I haven't written any code to handle VCARD's date syntax, so the date
won't get parsed into a Python date or datetime. But you can add the
value parameter, if you want to. vobject gives you access to parameters
by adding _param to the parameter name, so:
>>> import vobject
>>> card = vobject.vCard()
>>> card.add('bday').value = "1980-09-26"
>>> card.bday.value_param = "DATE"
>>> print card.bday.serialize()
BDAY;VALUE=DATE:1980-09-26
Sincerely,
Jeffrey
More information about the VObject
mailing list