Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

Commit d7255b7

Browse files
committed
Use normalized date and timestamp for COMPLETED field
1 parent 3b2d26a commit d7255b7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/builder/CompletedBuilder.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ package at.bitfire.synctools.mapping.tasks.builder
88

99
import android.content.Entity
1010
import at.bitfire.ical4android.Task
11+
import at.bitfire.synctools.icalendar.DatePropertyTzMapper.normalizedDate
12+
import at.bitfire.synctools.util.AndroidTimeUtils.toTimestamp
1113
import org.dmfs.tasks.contract.TaskContract.Tasks
1214

1315
class CompletedBuilder : DmfsTaskFieldBuilder {
1416

1517
override fun build(from: Task, to: Entity) {
1618
// COMPLETED must always be a DATE-TIME
17-
to.entityValues.put(Tasks.COMPLETED, from.completedAt?.date?.toEpochMilli())
19+
to.entityValues.put(Tasks.COMPLETED, from.completedAt?.normalizedDate()?.toTimestamp())
1820
to.entityValues.put(Tasks.COMPLETED_IS_ALLDAY, 0)
1921
}
2022

0 commit comments

Comments
 (0)