fix(caldav): make sure duration and due date follow rfc5545
continuous-integration/drone/push Build is failing Details

Related discussion: https://community.vikunja.io/t/error-with-davx-synchronization/810
This commit is contained in:
kolaente 2022-09-07 15:39:40 +02:00
parent f814dd03eb
commit aaeffe925e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 5 deletions

View File

@ -181,6 +181,10 @@ SUMMARY:` + t.Summary + getCaldavColor(t.Color)
if t.Start.Unix() > 0 {
caldavtodos += `
DTSTART:` + makeCalDavTimeFromTimeStamp(t.Start)
if t.Duration != 0 && t.DueDate.Unix() == 0 {
caldavtodos += `
DURATION:PT` + formatDuration(t.Duration)
}
}
if t.End.Unix() > 0 {
caldavtodos += `
@ -217,11 +221,6 @@ DUE:` + makeCalDavTimeFromTimeStamp(t.DueDate)
CREATED:` + makeCalDavTimeFromTimeStamp(t.Created)
}
if t.Duration != 0 {
caldavtodos += `
DURATION:PT` + formatDuration(t.Duration)
}
if t.Priority != 0 {
caldavtodos += `
PRIORITY:` + strconv.Itoa(mapPriorityToCaldav(t.Priority))