From 85a524e5d51930f0d6aeb480076318b89507afa1 Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Thu, 1 Sep 2005 19:21:16 +0000 Subject: [PATCH] make adding a duration be done in parts, instead of converting to seconds. bug 303826, r=dmose --- calendar/libical/src/libical/icalduration.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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);