Bug 282169 - JJ: exported BDAY VCard field is too precise
Summary: JJ: exported BDAY VCard field is too precise
Status: RESOLVED FIXED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 20:59 UTC by Tristan Miller
Modified: 2012-01-30 15:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2011-09-16 20:59:16 UTC
Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

The "Personal" tab of the "Edit/New contact" dialog has a "Birthdate" field which allows one to enter a year, month, and day date.  However, when the contact is exported as a VCard, an arbitrary (and therefore probably incorrect) time of day is appended.  Example:

BDAY:1958-01-20T00:00:00Z

Since the user did not specify the time of day for the birth, this value is almost certainly incorrect.  RFC 2426 <http://www.ietf.org/rfc/rfc2426.txt> states that the BDAY field can omit the time if it is unknown or not desired.  Example:

BDAY:1958-01-20

Since almost nobody knows or cares about indicating the time of birth in their VCards, the simplest way to fix this bug is to simply have kaddressbook omit the superfluous "T00:00:00Z" when exporting a contact.

Reproducible: Always

Steps to Reproduce:
1. Create a new or edit and exist contact and add a birthdate.
2. Select the contact.
3. File->Export->Export vCard 3.0…
4. Enter a filename and save

Actual Results:  
5. The file contains a BDAY field which is too precise

Expected Results:  
5. The file should contain a BDAY field which specifies only the year, month, and day.

This was previously reported for kab3 as Bug 118289.  It still exists with the new KDE 4 address book.
Comment 1 Jonathan Marten 2012-01-22 15:02:58 UTC
Confirmed with current master.

Having the superfluous time field, even if allowed by the RFC, appears to prevent the birthday from being imported properly into Google Mail contacts, or synchronised with Android.
Comment 2 Jonathan Marten 2012-01-23 20:31:53 UTC
Patch submitted for review at https://git.reviewboard.kde.org/r/103776/
Comment 3 Jonathan Marten 2012-01-30 15:24:51 UTC
Git commit 84878698a188f1f0729c3fd5379fcd79b46ae7e8 by Jonathan Marten.
Committed on 30/01/2012 at 16:12.
Pushed by marten into branch 'master'.

Explicitly set the time component of the entered birthday to invalid.

The QDateTime constructor sets it to midnight if an invalid time
is specified.  This persists throughout the storage and export, and
creates vCard files that GMail and Android fail to read.
REVIEW:103776
FIXED-IN:4.8.1

M  +6    -1    akonadi/contact/editor/contacteditorwidget.cpp

http://commits.kde.org/kdepimlibs/84878698a188f1f0729c3fd5379fcd79b46ae7e8
Comment 4 Jonathan Marten 2012-01-30 15:27:22 UTC
Git commit 2e8952538a104034f0e840f1b6104b805b24c45a by Jonathan Marten.
Committed on 30/01/2012 at 16:12.
Pushed by marten into branch 'KDE/4.8'.

Explicitly set the time component of the entered birthday to invalid.

The QDateTime constructor sets it to midnight if an invalid time
is specified.  This persists throughout the storage and export, and
creates vCard files that GMail and Android fail to read.
REVIEW:103776
FIXED-IN:4.8.1

M  +6    -1    akonadi/contact/editor/contacteditorwidget.cpp

http://commits.kde.org/kdepimlibs/2e8952538a104034f0e840f1b6104b805b24c45a