1
0

fix(caldav): use const for repeat modes

This commit is contained in:
kolaente
2022-12-24 14:34:59 +01:00
parent 194b88e2eb
commit 897a6e5d5c
3 changed files with 10 additions and 11 deletions

View File

@ -22,6 +22,8 @@ import (
"strings"
"time"
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/api/pkg/utils"
)
@ -62,7 +64,7 @@ type Todo struct {
DueDate time.Time
Duration time.Duration
RepeatAfter int64
RepeatMode string
RepeatMode models.TaskRepeatMode
Created time.Time
Updated time.Time // last-mod
@ -227,8 +229,8 @@ CREATED:` + makeCalDavTimeFromTimeStamp(t.Created)
PRIORITY:` + strconv.Itoa(mapPriorityToCaldav(t.Priority))
}
if t.RepeatAfter > 0 || t.RepeatMode == "MONTHLY" {
if t.RepeatMode == "MONTHLY" {
if t.RepeatAfter > 0 || t.RepeatMode == models.TaskRepeatModeMonth {
if t.RepeatMode == models.TaskRepeatModeMonth {
caldavtodos += `
RRULE:FREQ=MONTHLY;BYMONTHDAY=` + t.DueDate.Format("02") // Day of the month
} else {