khal icon indicating copy to clipboard operation
khal copied to clipboard

Handling partial birthdays from vcf files

Open samdmarshall opened this issue 8 years ago • 9 comments

I have a bunch of contacts that I have birthdays stored for without their birth-year attached in my iCloud account. Apparently the way that Apple handles this is by exporting the VCF as the following:

BDAY;X-APPLE-OMIT-YEAR=1604:1604-05-09

This works fine in Apple's software, but not so much when attaching this to khal, as it will display their birth-year as 1604 (and thus, such contacts will be display as having their 413th birthday this year). I assume that Apple does this as a work-around to the official spec, and that there is no proper way to handle a date without a year attached to it. Since khal supports search a directory of .vcf files to get the birth date for each contact, is there a way to just have it display as "Jane Smith's Birthday" rather than "Jane Smith's 413th Birthday"?

Thanks.

samdmarshall avatar May 09 '17 23:05 samdmarshall

There actually is a way to deal with that in the standard, e.g., BDAY:--0415. I'm somewhat hesitant to support non-standard additions like this.

geier avatar May 10 '17 15:05 geier

My understanding is that only works for vcards using the 4.0 spec, not prior. I opened an issue on khard about this as well. The general consensus seems to be not wanting to support non-standard additions (which i totally understand and agree with).

samdmarshall avatar May 10 '17 16:05 samdmarshall

Oops, you are totally right, that really only works for vcard 4.0. Perhaps we should work around this issue therefore.

geier avatar May 10 '17 17:05 geier

+1

BEGIN:VCARD
VERSION:3.0
BDAY:1977-12-08
...

This birthday is not recognized. Also in documentation, there is:

If set to birthdays khal will expect a VCARD collection and extract birthdays from those VCARDS, that is only files with .ics extension will be considered, all other files will be ignored...

Is it realy *.ics extension for VCARDS, not *.vcf??? Thanks.

petr-fischer avatar Oct 24 '17 12:10 petr-fischer

Nope, this is an error in the documentation, thanks for spotting it.

geier avatar Oct 24 '17 12:10 geier

actually this has been fixed before (the vcf issue).

geier avatar Oct 24 '17 12:10 geier

hi, checking in to see status of this. i came across the problem again yesterday with khal claiming it was a friend of mine’s 416th birthday; is the only option here to make a workaround when this value is missing the year?

samdmarshall avatar Mar 10 '19 19:03 samdmarshall

Since https://github.com/pimutils/vdirsyncer/pull/1066, vdirsyncer supports requesting vCard v4. Does apple use the standard format for birthdates in this case?

WhyNotHugo avatar Mar 03 '25 15:03 WhyNotHugo

Related: Fastmail uses X-FM-NO-MONTH and X-FM-NO-DAY respectively when the month and day is unknown.

WhyNotHugo avatar Mar 03 '25 15:03 WhyNotHugo