diff --git a/src/calanonsync/caldav.go b/src/calanonsync/caldav.go index 2040e02..576dff4 100644 --- a/src/calanonsync/caldav.go +++ b/src/calanonsync/caldav.go @@ -83,14 +83,14 @@ var fieldMatch = regexp.MustCompile(`^(\w+)[;:]`) // they are converted to local timezone and tried again. If that // also fails the event is NOT considered whole day! func (ical *ICal) Update(newStart, newEnd time.Time, wholeDay bool) { - if wholeDay && (newStart.Hour() != 0 || newStart.Minute() != 0 || - newEnd.Hour() != 0 || newEnd.Hour() != 0) { + if wholeDay && (newStart.Hour() != 0 || newStart.Minute() != 0 || newStart.Second() != 0 || + newEnd.Hour() != 0 || newEnd.Minute() != 0 || newEnd.Second() != 0) { newStart = newStart.In(time.Local) newEnd = newEnd.In(time.Local) - if newStart.Hour() != 0 || newStart.Minute() != 0 || - newEnd.Hour() != 0 || newEnd.Hour() != 0 { + if newStart.Hour() != 0 || newStart.Minute() != 0 || newStart.Second() != 0 || + newEnd.Hour() != 0 || newEnd.Minute() != 0 || newEnd.Second() != 0 { log.Printf("Cannot update event %s as whole day.\n", ical.UID()) wholeDay = false