Comments (6)
@ArnyminerZ Can you please have a look (reproduce with a test first)? I think EventBuilder.buildEvent
should handle date
s with time zone, too (in the when (date) { … }
) to support this specific case. Since we can't store time zone info in the contacts provider, we have to convert it into UTC.
from vcard4android.
Reproduced with a copy-paste of testType_Birthday
:
@Test
fun testType_BirthdayWithTimezone() {
EventBuilder(Uri.EMPTY, null, Contact().apply {
birthDay = Birthday("19510311T000000+0100")
}, false).build().also { result ->
assertEquals(CommonDataKinds.Event.TYPE_BIRTHDAY, result[0].values[CommonDataKinds.Event.TYPE])
}
}
from vcard4android.
Does unfortunately not seem to be fixed in 4.3.9 yet :-/
This is the vcard:
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.4.2//EN
UID:LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0
N:Doe;John;;;
FN:John Doe
BDAY:20010415T000000+0200
ITEM1.ADR:;; ;;;;Nederland
ITEM1.X-ABLABEL:Home
CATEGORIES:_personen
GENDER:M
END:VCARD
From the logs:
2023-10-31 21:53:03 46 [network.HttpClient] <?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/addressbooks/users/frara/contacts/LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0.vcf</d:href><d:propstat><d:prop><d:getcontenttype>text/vcard; charset=utf-8</d:getcontenttype><d:getetag>"6d9b6a752c6858863a9018759b9dd5ae"</d:getetag><card:address-data>BEGIN:VCARD
VERSION:4.0
PRODID:-//Sabre//Sabre VObject 4.5.3//EN
UID:LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0
N:Doe;John;;;
FN:John Doe
BDAY:20010415T000000+0200
ITEM1.ADR:;; ;;;;Nederland
ITEM1.X-ABLABEL:Home
CATEGORIES:_personen
GENDER:M
END:VCARD
</card:address-data></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
2023-10-31 21:53:03 46 [network.HttpClient] <-- END HTTP (905-byte body)
2023-10-31 21:53:03 46 [syncadapter.ContactsSyncManager] Processing CardDAV resource LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0.vcf
2023-10-31 21:53:03 46 [syncadapter.ContactsSyncManager] Creating local contact
PARAMETER #0 = at.bitfire.vcard4android.Contact@4ce9893[addresses=[LabeledProperty(property=ezvcard.property.Address [ group=ITEM1 | parameters={} | poBoxes=[] | extendedAddresses=[] | streetAddresses=[ ] | localities=[] | regions=[] | postalCodes=[] | countries=[Nederland] ], label=Home)],anniversary=<null>,birthDay=ezvcard.property.Birthday [ group=null | parameters={} | text=null | date=2001-04-15T00:00+02:00 | partialDate=null ],categories=[_personen],customDates=[],displayName=John Doe,emails=[],familyName=Doe,givenName=John,group=false,impps=[],jobDescription=<null>,jobTitle=<null>,members=[],middleName=<null>,nickName=<null>,note=<null>,organization=<null>,phoneNumbers=[],phoneticFamilyName=<null>,phoneticGivenName=<null>,phoneticMiddleName=<null>,prefix=<null>,relations=[],suffix=<null>,uid=LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0,unknownProperties=BEGIN:VCARD
VERSION:4.0
GENDER:M
END:VCARD
,urls=[]]
2023-10-31 21:53:03 46 [contactrow.EventBuilder] Ignoring date/time without supported (partial) date
PARAMETER #0 = ezvcard.property.Birthday [ group=null | parameters={} | text=null | date=2001-04-15T00:00+02:00 | partialDate=null ]
2023-10-31 21:53:03 46 [BatchOperation] Committing 5 operations:
2023-10-31 21:53:03 46 [BatchOperation] #0: ContentProviderOperation(type=insert uri=content://com.android.contacts/raw_contacts?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={dirty=0, sync1=LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0, sync2=6d9b6a752c6858863a9018759b9dd5ae, sync4=1, account_name=Contactpersonen ([email protected] 6A), account_type=at.bitfire.davdroid.address_book, deleted=0, sourceid=LcjQnxjYhKYC9CZtYSgAnkDwrg6QDk-1345-0-0.vcf})
2023-10-31 21:53:03 46 [BatchOperation] #1: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=vnd.android.cursor.item/name, raw_contact_id=android.content.ContentProviderOperation$BackReference@325f0d0, data1=John Doe, data2=John, data3=Doe, data4=null, data5=null, data6=null, data7=null, data8=null, data9=null})
2023-10-31 21:53:03 46 [BatchOperation] #2: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=vnd.android.cursor.item/postal-address_v2, data10=Nederland, raw_contact_id=android.content.ContentProviderOperation$BackReference@76718c9, data1=Nederland, data2=0, data3=Home, data4= , data5=, data6=, data7=, data8=, data9=})
2023-10-31 21:53:03 46 [BatchOperation] #3: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=vnd.android.cursor.item/group_membership, raw_contact_id=android.content.ContentProviderOperation$BackReference@4e8fbce, data1=44})
2023-10-31 21:53:03 46 [BatchOperation] #4: ContentProviderOperation(type=insert uri=content://com.android.contacts/data?caller_is_syncadapter=true&account_name=Contactpersonen%20(fwiep%40fwiep.nl%206A)&account_type=at.bitfire.davdroid.address_book values={mimetype=x.davdroid/unknown-properties, raw_contact_id=android.content.ContentProviderOperation$BackReference@3402aef, data1=BEGIN:VCARD
VERSION:4.0
GENDER:M
END:VCARD
})
2023-10-31 21:53:03 46 [BatchOperation] Running 5 operations (0 .. 4)
2023-10-31 21:53:03 46 [BatchOperation] … 5 record(s) affected
I also noticed that there is a "&# 13;" at the end of each line of the processed vcard. Does this has something to do with it?
Please can you check again whats the case with this vcard? @ArnyminerZ
Reference: Zammad #2891
from vcard4android.
Guess that's becauseVCardDateFormat.parse
creates an OffsetDateTime
, not a ZonedDateTime
:
We should
- support OffsetDateTime in addition to (or if vCard doesn't support zoned date-times: instead of) ZonedDateTime,
- have a test for it,
- have a test that contains such a BDAY directly as raw string and sees whether it's converted correctly (to an OffsetDateTime) so that we can be sure that the whole conversion works in the future.
from vcard4android.
Hello again,
I had to wait for F-Droid to build and distribute the 4.3.10-ose package. Now I have tested and the problem is not yet fixed - but I think I know why.
If I compare the used library versions in the app's About dialog, I see the same vcard4android version as with 4.3.9-ose (b376d2e
), and not version a7a1f42
which contains the most recent fix.
Is this an issue with F-Droid's build process, or is there another way to get a true-full-up-to-date apk for testing?
Thanks and kind regards,
FWieP
from vcard4android.
@fwiep See #26 (comment)
from vcard4android.
Related Issues (18)
- Redesign vcard4android API HOT 1
- IM entries: use pre-defined protocols for Android<12 again HOT 2
- SIP: use TEL instead/additionally to IM
- Save contact photo into assets instead of PHOTO blob HOT 1
- Support IS_READ_ONLY for Data and Group rows HOT 1
- Update to ez-vcard 0.12.0 HOT 1
- Enable test HOT 2
- Unsupported field: YearOfEra causes sync error [t-online.de]
- Make vcard4android a real Android libary (instead of a submodule)
- test suite fails on Windows HOT 9
- KIND:GROUP (upper-case) not parsed as group contact
- vCard issue where names, addresses, and list organization is getting messed up. HOT 1
- Use gradle version catalog for dependencies
- Upgrade Dependencies HOT 1
- Contacts with only ORG get a wrong first/last name on sync
- Don't insert structured name when FN is not a real display name
- Broken EPIPE in PhotoBuilder HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vcard4android.