make adding a duration be done in parts, instead of converting to seconds.

bug 303826, r=dmose


git-svn-id: svn://10.0.0.236/trunk@179488 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mvl%exedo.nl
2005-09-01 19:21:16 +00:00
parent 059ea31f27
commit d965b91845

View File

@@ -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);