Version: unspecified (using KDE 4.4.2) OS: Linux Suppose that I import a vCard in Kaddressbook. I the vCard contains a line such as BDAY:1900-5-19 (note the one-digit month), then the date is not imported in the Kaddressbok contact. On the other hand, if the line is BDAY:1900-05-19 (note the month with a leading zero), the the date is correctly imported. This happens with both version 4.2.2 and 3.5 of Kaddressbook. Even if the vcard standard requires the two digit numbers, I think it would be better to support also the one-digit ones. I set the severity to "major", because actualy there is a data loss: when importing the vCards, the date gets lost. Reproducible: Always Steps to Reproduce: Just try to import a vCard file, once with a line BDAY:1900-05-19 then import the same file, but with that line modified into BDAY:1900-5-19 without the zero Actual Results: In the first case the date is imported, and in the second is not Expected Results: the date should be imported in both cases OS: Linux (x86_64) release 2.6.32-21-generic Compiler: cc
It would appear kdepim is using a strict date parser, I'd guess QDate but I haven't checked. If you need a liberal date parser then KCaledarSystem::readDate() does that, just don't use the KGlobal calendar to access it as it may not be Gregorian and you'd get the wrong date.
Hej Marco, BDAY:1900-5-19 is simply _invalid_ according to the RFC (2426/2425), so I see no point in supporting broken vCards. Please inform the creator of the software which creates such broken vCards so that he will fix his product. Ciao, Tobias
(In reply to comment #2) > Hej Marco, > > BDAY:1900-5-19 is simply _invalid_ according to the RFC (2426/2425), so I see > no point in supporting broken vCards. Please inform the creator of the software > which creates such broken vCards so that he will fix his product. It is very likely that the broken vcards come from a highly proprietary product. Only those do not care about implementing standards correctly. Since it seems to we have a not to complex way to fix these vcards on reading (if I understand John's comment correctly), we should consider this at least for "import vcards"
"Remember Postel's Prescription: Be generous in what you accept, rigorous in what you emit." (See http://www.faqs.org/docs/artu/ch11s06.html ) So I think that Kaddressbook should accept (of course only when importing vCards generated elsewhere) also dates in which the leading zeros are missing. The fix can is very simple: if the month or the day are one digit only, then add a leading zero. The broken vCards come from this Facebook application: http://www.facebook.com/apps/application.php?id=75422854687&ref=ts http://apps.facebook.com/getvcard/ which is probably proprietary, but certainly not a "highly proprietary" one.
I'm with Postel :-) If a user wishes to 'escape' from a program that doesn't implement the standard properly and migrate to a program that does, then we should try import all their data where reasonable. I've checked and KDateTime::fromString() is also a 'generous' parser which would better suit the task as it is always a Gregorian calendar.