Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bitfireAT/ical4android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lang <72232737+patrickunterwegs@users.noreply.github.com>2022-02-28 19:42:53 +0300
committerGitHub <noreply@github.com>2022-02-28 19:42:53 +0300
commit5f8e5a656c00b1e1bb9adc2593d147c5c6b9dfde (patch)
tree52a0871b648c74c39141a557a10913839f6b64f4
parent00f63f5a4f59daa94c3f2959cc9a081ae9ed9a2f (diff)
suppress export of child relation (#21)
* suppress export of child relation * Don't export X-COMPLETEDTIMEZONE:ALLDAY if no completed time was set
-rw-r--r--src/main/java/at/bitfire/ical4android/JtxICalObject.kt16
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()) {