diff options
Diffstat (limited to 'src/main/java/at/bitfire/ical4android/JtxICalObject.kt')
-rw-r--r-- | src/main/java/at/bitfire/ical4android/JtxICalObject.kt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/at/bitfire/ical4android/JtxICalObject.kt b/src/main/java/at/bitfire/ical4android/JtxICalObject.kt index 054fde1..e898ad1 100644 --- a/src/main/java/at/bitfire/ical4android/JtxICalObject.kt +++ b/src/main/java/at/bitfire/ical4android/JtxICalObject.kt @@ -969,13 +969,15 @@ duration?.let(props::add) if(component == JtxContract.JtxICalObject.Component.VTODO.name) { completed?.let { - //Completed is defines as always DateTime! And is always UTC!? - + //Completed is defines as always DateTime! And is always UTC! But the X_PROP_COMPLETEDTIMEZONE can still define a timezone props += Completed(DateTime(it)) + + // only take completedTimezone if there was the completed time set + completedTimezone?.let { complTZ -> + props += XProperty(X_PROP_COMPLETEDTIMEZONE, complTZ) + } } - completedTimezone?.let { - props += XProperty(X_PROP_COMPLETEDTIMEZONE, it) - } + percent?.let { props += PercentComplete(it) } @@ -1683,8 +1685,8 @@ duration?.let(props::add) collection.client.query( relatedToUrl, null, - "${JtxContract.JtxRelatedto.ICALOBJECT_ID} = ?", - arrayOf(this.id.toString()), + "${JtxContract.JtxRelatedto.ICALOBJECT_ID} = ? AND ${JtxContract.JtxRelatedto.RELTYPE} = ?", + arrayOf(this.id.toString(), JtxContract.JtxRelatedto.Reltype.PARENT.name), null )?.use { cursor -> while (cursor.moveToNext()) { |