diff --git a/calendar/libical/src/libical/icalduration.c b/calendar/libical/src/libical/icalduration.c index b54e1b1e99a6..4ec44537bdd9 100644 --- a/calendar/libical/src/libical/icalduration.c +++ b/calendar/libical/src/libical/icalduration.c @@ -310,9 +310,11 @@ int icaldurationtype_is_bad_duration(struct icaldurationtype d) struct icaltimetype icaltime_add(struct icaltimetype t, struct icaldurationtype d) { - int dt = icaldurationtype_as_int(d); - - t.second += dt; + t.second += d.seconds; + t.minute += d.minutes; + t.hour += d.hours; + t.day += d.days; + t.day += d.weeks * 7; t = icaltime_normalize(t);